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

@ -8,5 +8,18 @@ type Emote struct {
MetadataId string
Name string
// Server RemoteServer // `gorm:"foreignKey:ServerId;references:ID"`
ServerId string
ServerId uint
}
func (s *Storage) GetEmoteById(id uint) (*Emote, error) {
out := Emote{}
err := s.db.First(&out, id).Error
switch err {
case nil:
return &out, nil
case gorm.ErrRecordNotFound:
return nil, ErrEntryNotFound
default:
return nil, err
}
}