mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-29 18:26:34 +02:00
21 lines
461 B
TypeScript
21 lines
461 B
TypeScript
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;
|
|
};
|