Skip to content

Commit

Permalink
refactor: use fetch API
Browse files Browse the repository at this point in the history
  • Loading branch information
xabufr committed Sep 18, 2024
1 parent 12eaf65 commit c661f09
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/RequestList/RequestItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,12 @@ const RequestItem = ({ request, revalidateList }: RequestItemProps) => {

const deleteMediaFile = async () => {
if (request.media) {
await axios.delete(`/api/v1/media/${request.media.id}/file`);
await axios.delete(`/api/v1/media/${request.media.id}`);
await fetch(`/api/v1/media/${request.media.id}/file`, {
method: 'DELETE',
});
await fetch(`/api/v1/media/${request.media.id}`, {
method: 'DELETE',
});
revalidateList();
}
};
Expand Down

0 comments on commit c661f09

Please sign in to comment.