fix: lieve modifica ad db ed un typo

next-astro
parent 01982942a8
commit d5897ac50f

@ -15,7 +15,7 @@ var Slot = sl.NewSlot[Database]()
type Database interface {
// User
CreateUser(user model.User) error
CreateUser(user model.User) (db.Ref[model.User], error)
ReadUser(id db.Ref[model.User]) (model.User, error)
ReadUsers() ([]model.User, error)
UpdateUser(user model.User) error
@ -40,9 +40,9 @@ type Memory struct {
Users []model.User
}
func (m *Memory) CreateUser(user model.User) error {
func (m *Memory) CreateUser(user model.User) (db.Ref[model.User], error) {
m.Users = append(m.Users, user)
return nil
return db.Ref[model.User](user.Id), nil
}
func (m *Memory) ReadUser(id db.Ref[model.User]) (model.User, error) {

@ -16,7 +16,6 @@ var Slot = sl.NewSlot[*Server]()
var ApiRoutesHook = sl.NewHook[fiber.Router]()
func Configure(l *sl.ServiceLocator) (*Server, error) {
cfg, err := sl.Use(l, config.Slot)
if err != nil {
return nil, err

Loading…
Cancel
Save