Reject work result

As a creator, I want to reject the work a developer submitted because the solution is not working

Input parameters

  • taskId
  • rejectionReason

How to call from app

HTTP request to: /reject-work-result/TASKID

import { httpsCallable } from 'firebase/functions';

await httpsCallable(functions, 'rejectWorkResult')({ 
    taskId: task.id,
    rejectionReason: currentTask.rejectionReason,
})

Logic

  1. The frontend (app.tasksource.io) calls the API (/reject-work-result/TASK-ID)

  2. the backend should now set a field in the task document (workResultIsAccepted = false) as well as the (workResultRejectionReason = workResultRejectionReason) field and the (submittedForReview = false)

  3. Send First Email:

    • to_email_adress = email_of_assigned_person

    • template_name = "work-result-rejected->developer"

    • data = {taskData: taskData, taskId: taskId, rejectionReason: rejectionReason}

  4. Send Second Email:

    • to_email_adress = email_of_task_creator

    • template_name = "work-result-rejected->creator"

    • data = {taskData: taskData, taskId: taskId, rejectionReason: rejectionReason}

Last updated