mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-18 03:16:21 +02:00
First public commit
This commit is contained in:
commit
e05cd62e53
228 changed files with 17717 additions and 0 deletions
21
api-client/create-poll.ts
Normal file
21
api-client/create-poll.ts
Normal 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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue