Add test for import job handler. Improve error messages.

This commit is contained in:
Jan Eitzinger
2022-09-23 15:23:45 +02:00
parent c9184a7575
commit 5c715b6ec2
8 changed files with 838 additions and 7 deletions

View File

@@ -160,8 +160,7 @@ func (r *JobRepository) Find(
// The job is queried using the database id.
// It returns a pointer to a schema.Job data structure and an error variable.
// To check if no job was found test err == sql.ErrNoRows
func (r *JobRepository) FindById(
jobId int64) (*schema.Job, error) {
func (r *JobRepository) FindById(jobId int64) (*schema.Job, error) {
q := sq.Select(jobColumns...).
From("job").Where("job.id = ?", jobId)
return scanJob(q.RunWith(r.stmtCache).QueryRow())