add button to delete podcast & link to website
This commit is contained in:
@@ -47,3 +47,14 @@ export const useCreatePodcastMutation = () => {
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export const useDeletePodcastMutation = () => {
|
||||
return useMutation({
|
||||
mutationFn: async ({ id }: { id: number }) => {
|
||||
const resp = await fetch(`/api/podcasts/${id}`, {
|
||||
method: "DELETE",
|
||||
});
|
||||
return await resp.json();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user