MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / GetUserById

Function GetUserById

internal/db/user.go:36–42  ·  view source on GitHub ↗
(id uint)

Source from the content-addressed store, hash-verified

34}
35
36func GetUserById(id uint) (*model.User, error) {
37 var u model.User
38 if err := db.First(&u, id).Error; err != nil {
39 return nil, errors.Wrapf(err, "failed get old user")
40 }
41 return &u, nil
42}
43
44func CreateUser(u *model.User) error {
45 return errors.WithStack(db.Create(u).Error)

Callers 5

GetUserByIdFunction · 0.92
DeleteUserByIdFunction · 0.92
UpdateUserFunction · 0.92
Cancel2FAByIdFunction · 0.92
FinishAuthnLoginFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected