Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

revalidate

Kiran K47aa43ec441b
diff --git a/apps/web/lib/actions/add-bank-account.ts b/apps/web/lib/actions/add-bank-account.ts
index fec6aab59b..920e91553e 100644
--- a/apps/web/lib/actions/add-bank-account.ts
+++ b/apps/web/lib/actions/add-bank-account.ts
@@ -1,7 +1,6 @@
"use server";
import { prisma } from "@/lib/prisma";
-import { revalidatePath } from "next/cache";
import { z } from "zod";
import { addAppAchAccount } from "../dots/add-app-ach-account";
import { createDotsApp } from "../dots/create-dots-app";
@@ -52,7 +51,5 @@ export const addBankAccount = authActionClient
},
});
- revalidatePath("/");
-
return achAccount;
});
diff --git a/apps/web/ui/modals/add-bank-account-modal.tsx b/apps/web/ui/modals/add-bank-account-modal.tsx
index fab2eb2627..0b27194154 100644
--- a/apps/web/ui/modals/add-bank-account-modal.tsx
+++ b/apps/web/ui/modals/add-bank-account-modal.tsx
@@ -17,8 +17,7 @@ interface AddBankAccountProps {
type BankAccount = z.infer<typeof addBankAccountSchema>;
interface AddBankAccountFormProps {
- onCancel: () => void;
- onSuccess: () => void;
+ closeModal: () => void;
}
const AddBankAccount = ({ showModal, setShowModal }: AddBankAccountProps) => {
@@ -32,20 +31,14 @@ const AddBankAccount = ({ showModal, setShowModal }: AddBankAccountProps) => {
Add bank account
</h3>
<div className="scrollbar-hide mt-6 max-h-[calc(100dvh-200px)] overflow-auto overflow-y-scroll">
- <AddBankAccountForm
- onSuccess={() => setShowModal(false)}
- onCancel={() => setShowModal(false)}
- />
+ <AddBankAccountForm closeModal={() => setShowModal(false)} />
</div>
</Modal>
);
};
-const AddBankAccountForm = ({
- onCancel,
- onSuccess,
-}: AddBankAccountFormProps) => {
- const { id: workspaceId } = useWorkspace();
+const AddBankAccountForm = ({ closeModal }: AddBankAccountFormProps) => {
+ const { id: workspaceId, mutate } = useWorkspace();
const {
register,
@@ -60,7 +53,8 @@ const AddBankAccountForm = ({
toast.success(
"Bank account added successfully. Waiting for verification.",
);
- onSuccess();
+ mutate();
+ closeModal();
},
onError({ error }) {
toast.error(error.serverError?.serverError);
@@ -143,7 +137,7 @@ const AddBankAccountForm = ({
variant="secondary"
text="Cancel"
className="h-9 w-fit"
- onClick={onCancel}
+ onClick={closeModal}
/>
<Button