feat(FE): Support per-kandang sales fetching

This commit is contained in:
rstubryan
2026-01-13 11:00:36 +07:00
parent 0f5ac917d2
commit 06accca19e
2 changed files with 26 additions and 2 deletions
+17
View File
@@ -37,6 +37,23 @@ export class ClosingApiService extends BaseApiService<Closing, null, null> {
}
}
async getPenjualanByKandang(
closingId: number,
kandangId: number
): Promise<BaseApiResponse<ClosingSales> | undefined> {
try {
const path = `${this.basePath}/${closingId}/${kandangId}/penjualan`;
return await httpClient<BaseApiResponse<ClosingSales>>(path, {
method: 'GET',
});
} catch (error) {
if (axios.isAxiosError<BaseApiResponse<ClosingSales>>(error)) {
return error.response?.data;
}
return undefined;
}
}
async getAllIncomingSapronakFetcher(
endpoint: string
): Promise<BaseApiResponse<ClosingIncomingSapronak[]>> {