mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 10:42:08 +00:00
chore: begin work on documenting client side requests code
This commit is contained in:
@@ -8,6 +8,17 @@ const BeerCommentValidationSchemaWithId = CreateCommentValidationSchema.extend({
|
||||
beerPostId: z.string().cuid(),
|
||||
});
|
||||
|
||||
/**
|
||||
* Sends a POST request to the server to create a new beer comment.
|
||||
*
|
||||
* @param data The data to be sent to the server.
|
||||
* @param data.beerPostId The ID of the beer post to comment on.
|
||||
* @param data.content The content of the comment.
|
||||
* @param data.rating The rating of the beer.
|
||||
* @returns A promise that resolves to the created comment.
|
||||
* @throws An error if the request fails, the API response is invalid, or the API response
|
||||
* payload is invalid.
|
||||
*/
|
||||
const sendCreateBeerCommentRequest = async ({
|
||||
beerPostId,
|
||||
content,
|
||||
|
||||
Reference in New Issue
Block a user