feat(FE-345): Add HPP expedition types and API method

This commit is contained in:
rstubryan
2025-12-18 15:49:01 +07:00
parent ecf1677c27
commit 4a8f2b1e1d
2 changed files with 40 additions and 0 deletions
+23
View File
@@ -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');