chore: begin work on documenting client side requests code

This commit is contained in:
Aaron William Po
2023-09-24 01:40:18 -04:00
parent 390ac8daf9
commit 39980eb8c3
7 changed files with 102 additions and 13 deletions

View File

@@ -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',