# Submit for review

### Input parameters

* ```
  taskId
  ```
* ```
  comment
  ```

### How to call from app

HTTP request to: /submit-task-for-review/TASKID

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

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

### Logic

1. The frontend (app.tasksource.io) calls the API endpoint

2. the backend should now set a field in the task document (submittedForReview = true)

3. Send First Email:

   * to\_email\_adress = email\_of\_assigned\_person
   * template\_name = "tasks-submitted-for-review->developer"
   * data = {taskData: taskData, taskId: taskId, comment: comment}

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