Below is my code snippet that deletes a record from a table.
async deleteTodo(id: number) {
this.todosRepository.delete(id);
}
I am trying to figure out how to handle messages during the deletion process.
For instance, if a user provides an identifier for a record that doesn't exist, I would like to display the message "record not found." Similarly, I want to handle any errors that occur during the deletion process.