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

21
api-client/create-poll.ts Normal file
View file

@ -0,0 +1,21 @@
import { Poll } from "@prisma/client";
import axios from "axios";
export interface CreatePollPayload {
title: string;
type: "date";
timeZone?: string;
location?: string;
description?: string;
user: {
name: string;
email: string;
};
options: string[];
demo?: boolean;
}
export const createPoll = async (payload: CreatePollPayload): Promise<Poll> => {
const { data } = await axios.post<Poll>("/api/poll", payload);
return data;
};