mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-29 18:26:34 +02:00
15 lines
389 B
TypeScript
15 lines
389 B
TypeScript
import axios from "axios";
|
|
|
|
export interface UpdateParticipantPayload {
|
|
pollId: string;
|
|
participantId: string;
|
|
name: string;
|
|
votes: string[];
|
|
}
|
|
|
|
export const updateParticipant = async (
|
|
payload: UpdateParticipantPayload,
|
|
): Promise<void> => {
|
|
const { pollId, participantId, ...body } = payload;
|
|
await axios.patch(`/api/poll/${pollId}/participant/${participantId}`, body);
|
|
};
|