Browse Source

update

master
CANCERYS\kw093 3 weeks ago
parent
commit
d9e9353ab6
2 changed files with 12 additions and 2 deletions
  1. +10
    -0
      src/app/api/warehouse/actions.ts
  2. +2
    -2
      src/components/ExcelFileImport/ExcelFileImport.tsx

+ 10
- 0
src/app/api/warehouse/actions.ts View File

@@ -12,4 +12,14 @@ export const importWarehouse = async (data: FormData) => {
}, },
); );
return importWarehouse; return importWarehouse;
}
export const importNewWarehouse = async (data: FormData) => {
const importWarehouse = await serverFetchString<string>(
`${BASE_API_URL}/warehouse/importNew`,
{
method: "POST",
body: data,
},
);
return importWarehouse;
} }

+ 2
- 2
src/components/ExcelFileImport/ExcelFileImport.tsx View File

@@ -6,7 +6,7 @@ import React, { ChangeEvent, useCallback, useMemo, useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { errorDialogWithContent, submitDialog, successDialog, successDialogWithContent } from "../Swal/CustomAlerts"; import { errorDialogWithContent, submitDialog, successDialog, successDialogWithContent } from "../Swal/CustomAlerts";
import { importStockTake } from "@/app/api/stockTake/actions"; import { importStockTake } from "@/app/api/stockTake/actions";
import { importWarehouse } from "@/app/api/warehouse/actions";
import { importWarehouse, importNewWarehouse } from "@/app/api/warehouse/actions";


interface Props { interface Props {
} }
@@ -41,7 +41,7 @@ const ExcelFileImport: React.FC<Props> = ({ }) => {
response = await importStockTake(formData) response = await importStockTake(formData)
break; break;
case "Import Warehouse": case "Import Warehouse":
response = await importWarehouse(formData)
response = await importNewWarehouse(formData)
break; break;
} }




Loading…
Cancel
Save