style: reformatted all files
This commit is contained in:
@@ -21,7 +21,8 @@ func (r *TaskRepository) CreateTask(ctx context.Context, t *task.Task) (*task.Ta
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING id, created_at, updated_at`
|
||||
|
||||
var createdTask task.Task
|
||||
err := r.db.QueryRowxContext(ctx, query, t.CompetitionId, t.Title, t.Description, t.InCompetitionPosition, t.MaxPoints, t.MaxAttempts, t.Type).StructScan(&createdTask)
|
||||
err := r.db.QueryRowxContext(ctx, query, t.CompetitionId, t.Title, t.Description, t.InCompetitionPosition, t.MaxPoints, t.MaxAttempts, t.Type).
|
||||
StructScan(&createdTask)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -46,7 +47,8 @@ func (r *TaskRepository) EditTask(ctx context.Context, t *task.Task) (*task.Task
|
||||
WHERE id = $7 RETURNING updated_at`
|
||||
|
||||
var updatedTask task.Task
|
||||
err := r.db.QueryRowxContext(ctx, query, t.Title, t.Description, t.InCompetitionPosition, t.MaxPoints, t.MaxAttempts, t.Type, t.Id).StructScan(&updatedTask)
|
||||
err := r.db.QueryRowxContext(ctx, query, t.Title, t.Description, t.InCompetitionPosition, t.MaxPoints, t.MaxAttempts, t.Type, t.Id).
|
||||
StructScan(&updatedTask)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -65,7 +67,11 @@ func (r *TaskRepository) ListCompetitionTasks(ctx context.Context, competitionID
|
||||
return tasks, err
|
||||
}
|
||||
|
||||
func (r *TaskRepository) GetTaskAttachments(ctx context.Context, taskID string, showPrivate bool) ([]*task.TaskAttachment, error) {
|
||||
func (r *TaskRepository) GetTaskAttachments(
|
||||
ctx context.Context,
|
||||
taskID string,
|
||||
showPrivate bool,
|
||||
) ([]*task.TaskAttachment, error) {
|
||||
var attachments []*task.TaskAttachment
|
||||
query := "SELECT * FROM task_attachments WHERE task_id = $1"
|
||||
args := []interface{}{taskID}
|
||||
@@ -76,4 +82,4 @@ func (r *TaskRepository) GetTaskAttachments(ctx context.Context, taskID string,
|
||||
|
||||
err := r.db.SelectContext(ctx, &attachments, query, args...)
|
||||
return attachments, err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user