Work on getting notes API
This commit is contained in:
parent
f656757710
commit
8a4c19dd17
9 changed files with 153 additions and 11 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue