Skip to content

Commit

Permalink
Merge branch 'partner-invite' of https://github.com/dubinc/dub into p…
Browse files Browse the repository at this point in the history
…artner-invite
  • Loading branch information
steven-tey committed Nov 16, 2024
2 parents 383bcf1 + 546e62e commit e7f0d9b
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions apps/web/ui/modals/archive-domain-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ const sendArchiveRequest = ({
});
};

const revalidateDomains = () => {
return mutate(
(key) => typeof key === "string" && key.startsWith("/api/domains"),
undefined,
{ revalidate: true },
);
};

function ArchiveDomainModal({
showArchiveDomainModal,
setShowArchiveDomainModal,
Expand Down Expand Up @@ -63,13 +71,7 @@ function ArchiveDomainModal({
return;
}

await mutate(
(key) => typeof key === "string" && key.startsWith("/api/domains"),
undefined,
{
revalidate: true,
},
);
revalidateDomains();
setShowArchiveDomainModal(false);
toastWithUndo({
id: "domain-archive-undo-toast",
Expand All @@ -89,12 +91,8 @@ function ArchiveDomainModal({
{
loading: "Undo in progress...",
error: "Failed to roll back changes. An error occurred.",
success: async () => {
await mutate(
(key) => typeof key === "string" && key.startsWith("/api/domains"),
undefined,
{ revalidate: true },
);
success: () => {
revalidateDomains();
return "Undo successful! Changes reverted.";
},
},
Expand Down

0 comments on commit e7f0d9b

Please sign in to comment.