mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-05 04:02:21 +02:00
Updated links model and poll page (#206)
* Improved sharing * Updated desktop poll
This commit is contained in:
parent
c4cbf2f6bb
commit
2ead375b42
50 changed files with 955 additions and 1848 deletions
|
@ -26,7 +26,7 @@ export const useAddParticipantMutation = () => {
|
|||
queryClient.setQueryData(
|
||||
["polls.participants.list", { pollId: participant.pollId }],
|
||||
(existingParticipants = []) => {
|
||||
return [participant, ...existingParticipants];
|
||||
return [...existingParticipants, participant];
|
||||
},
|
||||
);
|
||||
session.refresh();
|
||||
|
@ -79,12 +79,12 @@ export const useDeleteParticipantMutation = () => {
|
|||
};
|
||||
|
||||
export const useUpdatePollMutation = () => {
|
||||
const { poll } = usePoll();
|
||||
const { urlId, admin } = usePoll();
|
||||
const plausible = usePlausible();
|
||||
const queryClient = trpc.useContext();
|
||||
return trpc.useMutation(["polls.update"], {
|
||||
onSuccess: (data) => {
|
||||
queryClient.setQueryData(["polls.get", { urlId: poll.urlId }], data);
|
||||
queryClient.setQueryData(["polls.get", { urlId, admin }], data);
|
||||
plausible("Updated poll");
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue