feature/csv-clarion-exchange-type
This commit is contained in:
@@ -437,11 +437,20 @@ export const api = {
|
||||
|
||||
// CSV import for Tipos de Cambio (flujo en general_catalogs/exchange_rate/imports)
|
||||
exchangeRateImports: {
|
||||
upload: (file: File, companyId: number) => {
|
||||
upload: (
|
||||
file: File,
|
||||
companyId: number,
|
||||
params?: { reemplazar_sin_preguntar?: boolean; date_format?: string }
|
||||
) => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const search = new URLSearchParams({ company_id: String(companyId) });
|
||||
if (params?.reemplazar_sin_preguntar !== undefined)
|
||||
search.set('reemplazar_sin_preguntar', String(!!params.reemplazar_sin_preguntar));
|
||||
if (params?.date_format != null && params.date_format !== '')
|
||||
search.set('date_format', params.date_format);
|
||||
return fetchApi(
|
||||
`/v1/a76/exchange-rate/imports/upload?company_id=${companyId}`,
|
||||
`/v1/a76/exchange-rate/imports/upload?${search.toString()}`,
|
||||
{ method: 'POST', body: formData }
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user