mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-06-14 20:41:42 +00:00
feat: add inline edit for chick-in date in chickin logs
- Add updateChickinDate method to ChickinService (PATCH /production/chickins/chick-in-date) - Add pencil icon button next to each chickin date in ChickLogsView - Clicking the icon toggles an inline DateInput with Simpan/Batal buttons - Save button is disabled and shows loading state while request is in flight Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
import { BaseApiService } from '@/services/api/base';
|
||||
import { BaseApiResponse } from '@/types/api/api-general';
|
||||
import { httpClient } from '@/services/http/client';
|
||||
import axios from 'axios';
|
||||
|
||||
export class ChickinService extends BaseApiService<
|
||||
Chickin,
|
||||
@@ -16,6 +17,29 @@ export class ChickinService extends BaseApiService<
|
||||
super(basePath);
|
||||
}
|
||||
|
||||
async updateChickinDate(
|
||||
projectFlockKandangId: number,
|
||||
chickInDate: string
|
||||
): Promise<BaseApiResponse<{ message: string }> | undefined> {
|
||||
try {
|
||||
return await httpClient<BaseApiResponse<{ message: string }>>(
|
||||
`${this.basePath}/chick-in-date`,
|
||||
{
|
||||
method: 'PATCH',
|
||||
body: {
|
||||
project_flock_kandang_id: projectFlockKandangId,
|
||||
chick_in_date: chickInDate,
|
||||
},
|
||||
}
|
||||
);
|
||||
} catch (error: unknown) {
|
||||
if (axios.isAxiosError<BaseApiResponse<{ message: string }>>(error)) {
|
||||
return error.response?.data;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Approve single marketing data
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user