# Reject developer (creator)

### Input parameters

* ```
  taskId
  ```
* ```
  rejectionReason
  ```

### How to call from app

HTTP request to: /reject-task/TASKID

<pre><code>import { httpsCallable } from 'firebase/functions';

<strong>await httpsCallable(functions, 'rejectDeveloper')({ 
</strong>    taskId: task.id,
    rejectionReason: currentTask.rejectionReason,
})
</code></pre>

### Logic

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

2. the backend should now set a field in the task document (acceptedByCreator = false) as well as the rejectionReason field

3. Send First Email:

   * to\_email\_adress = email\_of\_assigned\_person
   * template\_name = "tasks-rejected-by-creator->developer"
   * data = {taskData: taskData, taskId: taskId, rejectionReason: rejectionReason}

4. Send Second Email:
   * to\_email\_adress = email\_of\_task\_creator
   * template\_name = "tasks-rejected-by-creator->creator"
   * data = {taskData: taskData, taskId: taskId, rejectionReason: rejectionReason}

5\. If task was assigned to pool (assignToPool = true) call api endpoint submit task&#x20;

6\. if assignToPool = false set task to draft status again
