diff --git a/components/workspace/file-upload.tsx b/components/workspace/file-upload.tsx index 6dba708..a6c9d95 100644 --- a/components/workspace/file-upload.tsx +++ b/components/workspace/file-upload.tsx @@ -21,7 +21,7 @@ export function FileUpload() { // Do whatever you want with the file contents const binaryStr = reader.result; if (binaryStr instanceof ArrayBuffer) { - const contents = Buffer.from(binaryStr).toString("ascii"); + const contents = Buffer.from(binaryStr).toString("utf-8"); // @ts-expect-error const filename = file.path!; diff --git a/components/workspace/upload-modal.tsx b/components/workspace/upload-modal.tsx index 698d7c5..9616c8b 100644 --- a/components/workspace/upload-modal.tsx +++ b/components/workspace/upload-modal.tsx @@ -38,7 +38,7 @@ export default function UploadModal() { // Do whatever you want with the file contents const binaryStr = reader.result; if (binaryStr instanceof ArrayBuffer) { - const contents = Buffer.from(binaryStr).toString("ascii"); + const contents = Buffer.from(binaryStr).toString("utf-8"); // @ts-expect-error const filename = file.path!; diff --git a/data/audit.ts b/data/audit.ts index 7d08bd4..51037ba 100644 --- a/data/audit.ts +++ b/data/audit.ts @@ -73,7 +73,9 @@ export function useAudit( transactionId?: string ) { return useSWRImmutable( - auditId && transactionId ? `audit-${auditId}-${transactionId}` : undefined, + auditId && transactionId + ? `audit-${auditType}-${auditId}-${transactionId}` + : undefined, async () => { const res = await fetch( `${URL_CONFIG[auditType].auditContractCode}?auditId=${auditId}&transactionId=${transactionId}` @@ -102,7 +104,7 @@ const auditReportSchema = z.record( export function useAuditReport(auditType?: AuditType, auditId?: string) { return useSWRImmutable( - auditId ? `audit-report-${auditId}` : undefined, + auditType && auditId ? `audit-report-${auditType}-${auditId}` : undefined, async () => { if (!auditType) return;