(taskId)
| 67 | * @returns {Promise<void>} A promise that resolves if the task exists and rejects with a `NotFound` error if the task does not exist. |
| 68 | */ |
| 69 | const assertTaskExists = async (taskId) => { |
| 70 | const { taskData } = await fetchTask(taskId); |
| 71 | if (!taskData) { |
| 72 | throw new NotFound(`Task with id ${taskId} does not exist.`); |
| 73 | } |
| 74 | return taskData.title; |
| 75 | }; |
| 76 | |
| 77 | /** |
| 78 | * Checks if a user or task with the given ID exists in the system. |
no test coverage detected