❌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
The frontend (app.tasksource.io) calls the API (/reject-work-result/TASK-ID)
the backend should now set a field in the task document (workResultIsAccepted = false) as well as the (workResultRejectionReason = workResultRejectionReason) field and the (submittedForReview = false)
Send First Email:
to_email_adress = email_of_assigned_person
template_name = "work-result-rejected->developer"
data = {taskData: taskData, taskId: taskId, rejectionReason: rejectionReason}
Send Second Email:to_email_adress = email_of_task_creatortemplate_name = "work-result-rejected->creator"data = {taskData: taskData, taskId: taskId, rejectionReason: rejectionReason}
Last updated