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

25
api-client/update-poll.ts Normal file
View file

@ -0,0 +1,25 @@
import { Poll } from "@prisma/client";
import axios from "axios";
export interface UpdatePollPayload {
title?: string;
timeZone?: string;
location?: string;
description?: string;
optionsToDelete?: string[];
optionsToAdd?: string[];
notifications?: boolean;
closed?: boolean;
}
export const updatePoll = async (
urlId: string,
payload: UpdatePollPayload,
): Promise<Poll> => {
try {
const { data } = await axios.patch<Poll>(`/api/poll/${urlId}`, payload);
return data;
} catch (err) {
throw err;
}
};