MCPcopy Create free account
hub / github.com/bricks-cloud/BricksLLM / UpdateUser

Method UpdateUser

internal/manager/user.go:74–93  ·  view source on GitHub ↗
(id string, uu *user.UpdateUser)

Source from the content-addressed store, hash-verified

72}
73
74func (m *UserManager) UpdateUser(id string, uu *user.UpdateUser) (*user.User, error) {
75 uu.UpdatedAt = time.Now().Unix()
76
77 if err := uu.Validate(); err != nil {
78 return nil, err
79 }
80
81 if uu.KeyIds != nil && len(uu.KeyIds) != 0 {
82 existing, err := m.ks.GetKeys(nil, uu.KeyIds, "")
83 if err != nil {
84 return nil, err
85 }
86
87 if len(existing) == 0 {
88 return nil, internal_errors.NewNotFoundError("keys are not found")
89 }
90 }
91
92 return m.us.UpdateUser(id, uu)
93}
94
95func (m *UserManager) UpdateUserViaTagsAndUserId(tags []string, uid string, uu *user.UpdateUser) (*user.User, error) {
96 uu.UpdatedAt = time.Now().Unix()

Callers

nothing calls this directly

Implementers 2

Storeinternal/storage/postgresql/postgresql
UserManagerinternal/manager/user.go

Calls 3

ValidateMethod · 0.65
GetKeysMethod · 0.65
UpdateUserMethod · 0.65

Tested by

no test coverage detected