mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-04-05 18:09:04 +00:00
chore: begin work on documenting client side requests code
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
import APIResponseValidationSchema from '@/validation/APIResponseValidationSchema';
|
||||
|
||||
/**
|
||||
* Sends a DELETE request to the server to delete a beer post with the given ID.
|
||||
*
|
||||
* @param id The ID of the beer post to delete.
|
||||
* @returns A Promise that resolves to the parsed API response.
|
||||
* @throws An error if the response fails or the API response is invalid.
|
||||
*/
|
||||
const deleteBeerPostRequest = async (id: string) => {
|
||||
const response = await fetch(`/api/beers/${id}`, {
|
||||
method: 'DELETE',
|
||||
|
||||
Reference in New Issue
Block a user