Skip to main content

deleteTask method

Future<void> deleteTask (String taskId, String creatorId)

<p>This function is used to delete a task.</p> <p>params:</p> <ul> <li><code>taskId</code> : id of a task need to be deleted.</li> <li><code>creatorId</code> : id of the task creator.</li> </ul>

Implementation

Future\<void\> deleteTask(String taskId, String creatorId) async \{
if (creatorId == _userConfig.currentUser.id) \{
await _databaseMutationFunctions
.refreshAccessToken(_userConfig.currentUser.refreshToken!);
final res = await _databaseMutationFunctions
.gqlAuthMutation(TaskQueries.deleteTask(taskId));
if (res != null) _tasks.removeWhere((task) =\> task.id == taskId);
\}
\}