diff options
Diffstat (limited to 'internal/database/repos')
-rw-r--r-- | internal/database/repos/questions.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/database/repos/questions.go b/internal/database/repos/questions.go index 67f9d1f..f444b05 100644 --- a/internal/database/repos/questions.go +++ b/internal/database/repos/questions.go @@ -4,7 +4,16 @@ import "demoon/internal/models" type QuestionsRepo interface { DBGetQuestion(id string) (*models.Question, error) - DBGetMixedUbung(id uint32) (*models.MixedUbung, error) // implemet; ai! + DBGetMixedUbung(id uint32) (*models.MixedUbung, error) +} + +func (p *Provider) DBGetMixedUbung(id uint32) (*models.MixedUbung, error) { + var ubung models.MixedUbung + err := p.db.Get(&ubung, "SELECT * FROM mixed_ubungs WHERE mixed_id = ?", id) + if err != nil { + return nil, err + } + return &ubung, nil } func (p *Provider) DBGetQuestion(id string) (*models.Question, error) { |