refactor(FE): Send selected record date to next-day API

This commit is contained in:
rstubryan
2026-01-24 12:53:54 +07:00
parent 52213fc8c4
commit 6307cdc0dc
2 changed files with 7 additions and 2 deletions
@@ -562,7 +562,10 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
nextDayRecordingUrl
? () => {
const projectFlockKandangId = projectFlockKandangLookup!.id;
return RecordingApi.nextDayRecording(projectFlockKandangId);
return RecordingApi.nextDayRecording(
projectFlockKandangId,
selectedRecordDate
);
}
: null
);
+3 -1
View File
@@ -74,7 +74,8 @@ export class RecordingService extends BaseApiService<
}
async nextDayRecording(
projectFlockId: number
projectFlockId: number,
recordDate?: string
): Promise<BaseApiResponse<NextDayRecording> | undefined> {
return await this.customRequest<BaseApiResponse<NextDayRecording>>(
`next-day`,
@@ -82,6 +83,7 @@ export class RecordingService extends BaseApiService<
method: 'GET',
params: {
project_flock_kandang_id: projectFlockId,
record_date: recordDate,
},
}
);