First public commit

This commit is contained in:
Luke Vella 2022-04-12 07:14:28 +01:00
commit e05cd62e53
228 changed files with 17717 additions and 0 deletions

View file

@ -0,0 +1,23 @@
import { Participant, Vote } from "@prisma/client";
import axios from "axios";
export interface AddParticipantPayload {
pollId: string;
name: string;
votes: string[];
}
export type AddParticipantResponse = Participant & {
votes: Vote[];
};
export const addParticipant = async (
payload: AddParticipantPayload,
): Promise<AddParticipantResponse> => {
const res = await axios.post<AddParticipantResponse>(
`/api/poll/${payload.pollId}/participant`,
payload,
);
return res.data;
};