mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
feat(FE-347): add getProductionData method
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
ClosingGeneralInformation,
|
||||
ClosingIncomingSapronak,
|
||||
ClosingOutgoingSapronak,
|
||||
ClosingProductionData,
|
||||
} from '@/types/api/closing';
|
||||
import { httpClient, httpClientFetcher } from '@/services/http/client';
|
||||
import { BaseApiResponse } from '@/types/api/api-general';
|
||||
@@ -49,6 +50,22 @@ export class ClosingApiService extends BaseApiService<Closing, null, null> {
|
||||
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');
|
||||
|
||||
Reference in New Issue
Block a user