feat(FE): Support fetching HPP ekspedisi by kandang

This commit is contained in:
rstubryan
2026-01-13 10:57:40 +07:00
parent a526772e02
commit 0f5ac917d2
2 changed files with 29 additions and 2 deletions
+17
View File
@@ -162,6 +162,23 @@ export class ClosingApiService extends BaseApiService<Closing, null, null> {
return undefined;
}
}
async getHppEkspedisiByKandang(
closingId: number,
kandangId: number
): Promise<BaseApiResponse<ClosingHppExpedition> | undefined> {
try {
const path = `${this.basePath}/${closingId}/${kandangId}/expedition-hpp`;
return await httpClient<BaseApiResponse<ClosingHppExpedition>>(path, {
method: 'GET',
});
} catch (error) {
if (axios.isAxiosError<BaseApiResponse<ClosingHppExpedition>>(error)) {
return error.response?.data;
}
return undefined;
}
}
}
export const ClosingApi = new ClosingApiService('/closings');