GetApplicationByID returns the application for the given id or nil.
(id uint)
| 24 | |
| 25 | // GetApplicationByID returns the application for the given id or nil. |
| 26 | func (d *GormDatabase) GetApplicationByID(id uint) (*model.Application, error) { |
| 27 | app := new(model.Application) |
| 28 | err := d.DB.Where("id = ?", id).Find(app).Error |
| 29 | if err == gorm.ErrRecordNotFound { |
| 30 | err = nil |
| 31 | } |
| 32 | if app.ID == id { |
| 33 | return app, err |
| 34 | } |
| 35 | return nil, err |
| 36 | } |
| 37 | |
| 38 | // CreateApplication creates an application. |
| 39 | func (d *GormDatabase) CreateApplication(application *model.Application) error { |
nothing calls this directly
no outgoing calls
no test coverage detected