mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 07:45:47 +00:00
feat(FE-347): add getProductionData method
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
|||||||
ClosingGeneralInformation,
|
ClosingGeneralInformation,
|
||||||
ClosingIncomingSapronak,
|
ClosingIncomingSapronak,
|
||||||
ClosingOutgoingSapronak,
|
ClosingOutgoingSapronak,
|
||||||
|
ClosingProductionData,
|
||||||
} from '@/types/api/closing';
|
} from '@/types/api/closing';
|
||||||
import { httpClient, httpClientFetcher } from '@/services/http/client';
|
import { httpClient, httpClientFetcher } from '@/services/http/client';
|
||||||
import { BaseApiResponse } from '@/types/api/api-general';
|
import { BaseApiResponse } from '@/types/api/api-general';
|
||||||
@@ -49,6 +50,22 @@ export class ClosingApiService extends BaseApiService<Closing, null, null> {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getProductionData(id: number) {
|
||||||
|
try {
|
||||||
|
const getProductionDataPath = `${this.basePath}/${id}/production-data`;
|
||||||
|
const getProductionDataRes = await httpClient<
|
||||||
|
BaseApiResponse<ClosingProductionData>
|
||||||
|
>(getProductionDataPath);
|
||||||
|
|
||||||
|
return getProductionDataRes;
|
||||||
|
} catch (error) {
|
||||||
|
if (axios.isAxiosError<BaseApiResponse<ClosingProductionData>>(error)) {
|
||||||
|
return error.response?.data;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ClosingApi = new ClosingApiService('/closing');
|
export const ClosingApi = new ClosingApiService('/closing');
|
||||||
|
|||||||
Reference in New Issue
Block a user