Skip to content

Commit

Permalink
fix: the deleting function is now functional
Browse files Browse the repository at this point in the history
Closes: #218
  • Loading branch information
ColinRgm committed Jan 14, 2025
1 parent e742083 commit 1d6d32c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nextjs-interface/src/app/ui/dashboard/DeleteEsp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export default function DeleteEsp({ id }: { id: string }) {
const response = await fetch(url, {
method: "POST",
body: JSON.stringify({
id_data: id
id_data: id,
}),
headers: {
Authorization: `Bearer ${getToken()}`,
"Content-Type": "application/json"
"Content-Type": "application/json",
},
});

Expand All @@ -25,7 +25,7 @@ export default function DeleteEsp({ id }: { id: string }) {
console.error(`une erreur lors de la suppression de l'ESP`);
console.error(await response.json());
} else {
console.log("Tout bon")
console.log("Tout bon");
}
} catch (error) {
console.error("Error: ", error);
Expand All @@ -37,4 +37,4 @@ export default function DeleteEsp({ id }: { id: string }) {
<Trash2 onClick={() => deleteEsp(id)} />
</div>
);
}
}

0 comments on commit 1d6d32c

Please sign in to comment.