Untitled
unknown
plain_text
9 months ago
389 B
5
Indexable
const handledeletetodo = async (id: string) => {
const response=await fetch (`${process.env.EXPO_PUBLIC_API_URL}/todos/${id}`,{
method:'DELETE',
headers:{
"Authorization": `Bearer ${await AsyncStorage.getItem('token')} `,
},
});
const updatedTodoList = todolist.filter((item) => item.todo_id !== id);
setTodolist(updatedTodoList);
};Editor is loading...
Leave a Comment