mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-24 06:16:25 +02:00
First public commit
This commit is contained in:
commit
e05cd62e53
228 changed files with 17717 additions and 0 deletions
18
api-client/create-comment.ts
Normal file
18
api-client/create-comment.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Comment } from "@prisma/client";
|
||||
import axios from "axios";
|
||||
|
||||
export interface CreateCommentPayload {
|
||||
pollId: string;
|
||||
content: string;
|
||||
authorName: string;
|
||||
}
|
||||
|
||||
export const createComment = async (
|
||||
payload: CreateCommentPayload,
|
||||
): Promise<Comment> => {
|
||||
const { data } = await axios.post<Comment>(
|
||||
`/api/poll/${payload.pollId}/comments`,
|
||||
payload,
|
||||
);
|
||||
return data;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue