Skip to content

Commit

Permalink
chore: updated the function
Browse files Browse the repository at this point in the history
  • Loading branch information
sharvil-lade committed Mar 30, 2024
1 parent 99ab21b commit 5ed5121
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions contracts/tasktrackr.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,13 @@ contract tasktrackr {
require(list[id].isCompleted, "Task is not completed yet");
delete list[id];
emit TaskDeleted(id);
count--;
}

function deleteIncompleteTask(uint256 id) public {
require(id < count, "Task with given ID does not exist");
require(!list[id].isCompleted, "Task is already completed");
delete list[id];
emit TaskDeleted(id);
count--;
}

// Delete according to ID
Expand All @@ -69,6 +67,5 @@ contract tasktrackr {
require(id < count, "Task with given ID does not exist");
emit TaskDeleted(id);
delete list[id];
count--;
}
}

0 comments on commit 5ed5121

Please sign in to comment.