Skip to content

Commit 224df97

Browse files
committed
chore: clean up variable names and use upload2 createTemplateCSV
1 parent 6beba90 commit 224df97

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

apps/web/src/routes/_app/upload/$instrumentId.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import { PageHeader } from '@/components/PageHeader';
1212
import { useInstrument } from '@/hooks/useInstrument';
1313
import { useUploadInstrumentRecordsMutation } from '@/hooks/useUploadInstrumentRecordsMutation';
1414
import { useAppStore } from '@/store';
15-
import { createUploadTemplateCSV, processInstrumentCSV, reformatInstrumentData } from '@/utils/upload';
15+
import { processInstrumentCSV, reformatInstrumentData } from '@/utils/upload';
16+
import { createUploadTemplateCSV } from '@/utils/upload2';
1617

1718
const $UploadError = z.object({
1819
message: z.string().nullable(),
@@ -39,8 +40,8 @@ const RouteComponent = () => {
3940

4041
const handleTemplateDownload = () => {
4142
try {
42-
const { content, fileName } = createUploadTemplateCSV(instrument!);
43-
void download(fileName, content);
43+
const { content, filename } = createUploadTemplateCSV(instrument!);
44+
void download(filename, content);
4445
} catch (error) {
4546
console.error(error);
4647
void navigate({
@@ -80,7 +81,10 @@ const RouteComponent = () => {
8081
await uploadInstrumentRecordsMutation.mutateAsync(reformattedData);
8182
} else {
8283
addNotification({
83-
message: processedDataResult.message,
84+
message: t({
85+
en: processedDataResult.message.en,
86+
fr: processedDataResult.message.fr
87+
}),
8488
type: 'error'
8589
});
8690
}

0 commit comments

Comments
 (0)