Add gRPC group deletion and custom entry fields

This commit is contained in:
Joe Julian
2026-03-29 11:21:41 -07:00
parent 6c1ccdad16
commit 5a6ba8ff57
6 changed files with 456 additions and 210 deletions
+13 -12
View File
@@ -7,19 +7,20 @@ import (
)
var ErrEntryNotFound = errors.New("entry not found")
var ErrGroupNotEmpty = errors.New("group is not empty")
type Entry struct {
ID string
Title string
Username string
Password string
URL string
Notes string
Tags []string
Fields map[string]string
ID string
Title string
Username string
Password string
URL string
Notes string
Tags []string
Fields map[string]string
Attachments map[string][]byte
History []Entry
Path []string
History []Entry
Path []string
}
type SearchResult struct {
@@ -323,12 +324,12 @@ func (m *Model) MoveTemplate(id string, path []string) error {
func (m *Model) DeleteGroup(path []string) error {
for _, entry := range m.Entries {
if slices.Equal(entry.Path, path) || hasPathPrefix(entry.Path, path) {
return errors.New("group is not empty")
return ErrGroupNotEmpty
}
}
for _, entry := range m.Templates {
if slices.Equal(entry.Path, path) || hasPathPrefix(entry.Path, path) {
return errors.New("group is not empty")
return ErrGroupNotEmpty
}
}