refactor: add logging to CreateTask resolver

This commit is contained in:
Jordan Knott 2020-08-23 17:51:28 -05:00
parent 46e724e731
commit dd50baa05a

View File

@ -180,13 +180,18 @@ func (r *mutationResolver) UpdateProjectMemberRole(ctx context.Context, input Up
func (r *mutationResolver) CreateTask(ctx context.Context, input NewTask) (*db.Task, error) {
taskGroupID, err := uuid.Parse(input.TaskGroupID)
createdAt := time.Now().UTC()
if err != nil {
log.WithError(err).Error("issue while parsing task group ID")
return &db.Task{}, err
}
createdAt := time.Now().UTC()
log.WithFields(log.Fields{"positon": input.Position, "taskGroupID": taskGroupID}).Info("creating task")
task, err := r.Repository.CreateTask(ctx, db.CreateTaskParams{taskGroupID, createdAt, input.Name, input.Position})
return &task, err
if err != nil {
log.WithError(err).Error("issue while creating task")
return &db.Task{}, err
}
return &task, nil
}
func (r *mutationResolver) DeleteTask(ctx context.Context, input DeleteTaskInput) (*DeleteTaskPayload, error) {