GetApplicationByToken returns the application for the given token or nil.
(token string)
| 11 | |
| 12 | // GetApplicationByToken returns the application for the given token or nil. |
| 13 | func (d *GormDatabase) GetApplicationByToken(token string) (*model.Application, error) { |
| 14 | app := new(model.Application) |
| 15 | err := d.DB.Where("token = ?", token).Find(app).Error |
| 16 | if err == gorm.ErrRecordNotFound { |
| 17 | err = nil |
| 18 | } |
| 19 | if app.Token == token { |
| 20 | return app, err |
| 21 | } |
| 22 | return nil, err |
| 23 | } |
| 24 | |
| 25 | // GetApplicationByID returns the application for the given id or nil. |
| 26 | func (d *GormDatabase) GetApplicationByID(id uint) (*model.Application, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected