diff --git a/.env-example b/.env-example
index f7fdbbb87c..43bb08067b 100644
--- a/.env-example
+++ b/.env-example
@@ -1,4 +1,3 @@
-NEXTAUTH_URL=http://localhost:3000
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
RESEND_API_KEY=
diff --git a/apps/dashboard/package.json b/apps/dashboard/package.json
index 503961070a..a2cf0bf1dc 100644
--- a/apps/dashboard/package.json
+++ b/apps/dashboard/package.json
@@ -5,7 +5,7 @@
"scripts": {
"build": "NODE_ENV=production next build",
"clean": "git clean -xdf .next .turbo node_modules",
- "jobs": "bunx @trigger.dev/cli@latest dev --port 3001",
+ "jobs": "bunx @trigger.dev/cli@latest dev --port 3001 --client-id=midday-CpkS",
"dev": "next dev -p 3001",
"lint": "next lint",
"format": "biome format --write .",
@@ -31,23 +31,23 @@
"framer-motion": "^10.16.5",
"next": "14.0.4-canary.4",
"next-international": "^1.1.4",
- "next-safe-action": "^5.0.3",
+ "next-safe-action": "^5.1.2",
"next-themes": "^0.2.1",
"next-usequerystate": "^1.12.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-dropzone": "^14.2.3",
"react-hook-form": "^7.48.2",
- "recharts": "^2.9.3",
+ "recharts": "^2.10.1",
"sharp": "^0.32.6",
"zod": "^3.22.4"
},
"devDependencies": {
"@midday/tsconfig": "workspace:*",
"@t3-oss/env-nextjs": "^0.7.1",
- "@types/node": "^20.9.1",
- "@types/react": "^18.2.37",
- "@types/react-dom": "^18.2.15",
- "typescript": "^5.2.2"
+ "@types/node": "^20.9.4",
+ "@types/react": "^18.2.38",
+ "@types/react-dom": "^18.2.17",
+ "typescript": "^5.3.2"
}
}
\ No newline at end of file
diff --git a/apps/dashboard/src/actions/export-transactions-action.ts b/apps/dashboard/src/actions/export-transactions-action.ts
index 84efa67a31..a051430f5f 100644
--- a/apps/dashboard/src/actions/export-transactions-action.ts
+++ b/apps/dashboard/src/actions/export-transactions-action.ts
@@ -19,6 +19,6 @@ export const exportTransactionsAction = action(
},
});
- console.log(event);
+ return event;
}
);
diff --git a/apps/dashboard/src/actions/schema.ts b/apps/dashboard/src/actions/schema.ts
index 9506e249ae..d7a0d763bb 100644
--- a/apps/dashboard/src/actions/schema.ts
+++ b/apps/dashboard/src/actions/schema.ts
@@ -66,6 +66,6 @@ export const createAttachmentsSchema = z.array(
export const deleteAttachmentSchema = z.string();
export const exportTransactionsSchema = z.object({
- from: z.string(),
- to: z.string(),
+ from: z.coerce.date(),
+ to: z.coerce.date(),
});
diff --git a/apps/dashboard/src/app/[locale]/@dashboard/(root)/transactions/page.tsx b/apps/dashboard/src/app/[locale]/@dashboard/(root)/transactions/page.tsx
index d0a394fca1..03539d1478 100644
--- a/apps/dashboard/src/app/[locale]/@dashboard/(root)/transactions/page.tsx
+++ b/apps/dashboard/src/app/[locale]/@dashboard/(root)/transactions/page.tsx
@@ -40,7 +40,13 @@ export default async function Transactions({
fallback={}
key={page}
>
-
+
diff --git a/apps/dashboard/src/app/api/download/document/route.ts b/apps/dashboard/src/app/api/download/document/route.ts
index a3eadb9962..510cbfe5cf 100644
--- a/apps/dashboard/src/app/api/download/document/route.ts
+++ b/apps/dashboard/src/app/api/download/document/route.ts
@@ -9,7 +9,7 @@ export async function GET(req, res) {
const path = requestUrl.searchParams.get("path");
const filename = requestUrl.searchParams.get("filename");
- const { data } = await supabase.storage.from("files").download(path);
+ const { data } = await supabase.storage.from("vault").download(path);
const responseHeaders = new Headers(res.headers);
responseHeaders.set(
diff --git a/apps/dashboard/src/components/attachments.tsx b/apps/dashboard/src/components/attachments.tsx
index d48a6ad4ed..988a193029 100644
--- a/apps/dashboard/src/components/attachments.tsx
+++ b/apps/dashboard/src/components/attachments.tsx
@@ -87,7 +87,7 @@ export function Attachments({ id, data }) {
const uploadedFiles = await Promise.all(
acceptedFiles.map(async (acceptedFile) => {
const { path } = await uploadFile({
- bucket: "files",
+ bucket: "vault",
path: `${userData?.team_id}/transactions/${id}`,
file: acceptedFile,
});
@@ -99,7 +99,7 @@ export function Attachments({ id, data }) {
transaction_id: id,
type: acceptedFile.type,
};
- }),
+ })
);
const { data: newFiles } = await createAttachmentsAction(uploadedFiles);
@@ -120,7 +120,7 @@ export function Attachments({ id, data }) {
diff --git a/apps/dashboard/src/components/modals/export-transactions-modal.tsx b/apps/dashboard/src/components/modals/export-transactions-modal.tsx
index 2b1586e105..f592a1388f 100644
--- a/apps/dashboard/src/components/modals/export-transactions-modal.tsx
+++ b/apps/dashboard/src/components/modals/export-transactions-modal.tsx
@@ -10,6 +10,7 @@ import {
DialogHeader,
DialogTitle,
} from "@midday/ui/dialog";
+import { useToast } from "@midday/ui/use-toast";
import { Loader2 } from "lucide-react";
import { useAction } from "next-safe-action/hook";
import { useSearchParams } from "next/navigation";
@@ -17,9 +18,10 @@ import { useEffect } from "react";
export function ExportTransactionsModal({ isOpen, setOpen }) {
const searchParams = useSearchParams();
- const { execute, status } = useAction(exportTransactionsAction);
+ const { execute, status, result } = useAction(exportTransactionsAction);
const filter = searchParams.get("filter");
const date = filter ? JSON.parse(filter)?.date : null;
+ const { toast } = useToast();
useEffect(() => {
if (status === "hasSucceeded" && isOpen) {
@@ -27,6 +29,21 @@ export function ExportTransactionsModal({ isOpen, setOpen }) {
}
}, [status]);
+ useEffect(() => {
+ if (result.data) {
+ toast({
+ duration: 6000,
+ title: "Exporting...",
+ description: "Your export is ready base on 46 transactions.",
+ // action: (
+ //
+ // Yes
+ //
+ // ),
+ });
+ }
+ }, [result]);
+
return (