GetApplicationsByUser returns all applications from a user.
(userID uint)
| 62 | |
| 63 | // GetApplicationsByUser returns all applications from a user. |
| 64 | func (d *GormDatabase) GetApplicationsByUser(userID uint) ([]*model.Application, error) { |
| 65 | var apps []*model.Application |
| 66 | err := d.DB.Where("user_id = ?", userID).Order("sort_key, id ASC").Find(&apps).Error |
| 67 | if err == gorm.ErrRecordNotFound { |
| 68 | err = nil |
| 69 | } |
| 70 | return apps, err |
| 71 | } |
| 72 | |
| 73 | // UpdateApplication updates an application. |
| 74 | func (d *GormDatabase) UpdateApplication(app *model.Application) error { |
no outgoing calls
no test coverage detected