MCPcopy Index your code
hub / github.com/pocketbase/pocketbase / checkUniqueName

Method checkUniqueName

apis/backup_create.go:61–78  ·  view source on GitHub ↗
(value any)

Source from the content-addressed store, hash-verified

59}
60
61func (form *backupCreateForm) checkUniqueName(value any) error {
62 v, _ := value.(string)
63 if v == "" {
64 return nil // nothing to check
65 }
66
67 fsys, err := form.app.NewBackupsFilesystem()
68 if err != nil {
69 return err
70 }
71 defer fsys.Close()
72
73 if exists, err := fsys.Exists(v); err != nil || exists {
74 return validation.NewError("validation_backup_name_exists", "The backup file name is invalid or already exists.")
75 }
76
77 return nil
78}

Callers

nothing calls this directly

Calls 3

NewBackupsFilesystemMethod · 0.65
CloseMethod · 0.65
ExistsMethod · 0.45

Tested by

no test coverage detected