mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-21 22:05:45 +00:00
feat(FE-345): Add HPP expedition types and API method
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
ClosingOutgoingSapronak,
|
||||
ClosingOverhead,
|
||||
ClosingSapronakCalculation,
|
||||
ClosingCostOfRevenueExpedition,
|
||||
} from '@/types/api/closing';
|
||||
import { httpClient, httpClientFetcher } from '@/services/http/client';
|
||||
import { BaseApiResponse } from '@/types/api/api-general';
|
||||
@@ -194,6 +195,28 @@ export class ClosingApiService extends BaseApiService<Closing, null, null> {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
async getHppEkspedisi(
|
||||
id: number
|
||||
): Promise<BaseApiResponse<ClosingCostOfRevenueExpedition> | undefined> {
|
||||
try {
|
||||
const getHppEkspedisiPath = `${this.basePath}/${id}/hpp-ekspedisi`;
|
||||
const getHppEkspedisiRes =
|
||||
await httpClient<BaseApiResponse<ClosingCostOfRevenueExpedition>>(
|
||||
getHppEkspedisiPath
|
||||
);
|
||||
return getHppEkspedisiRes;
|
||||
} catch (error) {
|
||||
if (
|
||||
axios.isAxiosError<BaseApiResponse<ClosingCostOfRevenueExpedition>>(
|
||||
error
|
||||
)
|
||||
) {
|
||||
return error.response?.data;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const ClosingApi = new ClosingApiService('/closings');
|
||||
|
||||
Reference in New Issue
Block a user