Work on getting notes API

This commit is contained in:
Melody Becker 2024-11-18 12:18:57 +01:00
parent f656757710
commit 8a4c19dd17
9 changed files with 153 additions and 11 deletions

View file

@ -168,8 +168,8 @@ func (s *Storage) FindAccountById(id string) (*Account, error) {
}
log.Debug().Str("account-id", id).Msg("Didn't hit account in cache, checking db")
acc = &Account{ID: id}
res := s.db.First(acc)
acc = &Account{}
res := s.db.Where(Account{ID: id}).First(acc)
if res.Error != nil {
if errors.Is(res.Error, gorm.ErrRecordNotFound) {
log.Warn().Str("account-id", id).Msg("Account not found")