diff --git a/src/services/api/production/transfer-to-laying.ts b/src/services/api/production/transfer-to-laying.ts index 85b556e3..22216e38 100644 --- a/src/services/api/production/transfer-to-laying.ts +++ b/src/services/api/production/transfer-to-laying.ts @@ -1,6 +1,10 @@ import axios from 'axios'; import { BaseApiService } from '@/services/api/base'; -import { BaseApiResponse, GroupedApprovals } from '@/types/api/api-general'; +import { + Approvals, + BaseApiResponse, + GroupedApprovals, +} from '@/types/api/api-general'; import { CreateTransferToLayingPayload, @@ -202,6 +206,33 @@ export class TransferToLayingService extends BaseApiService< return undefined; } } + + async getApprovalLineHistory( + transferToLayingId: number, + page: number = 1, + limit: number = 100 + ) { + try { + const approvalHistoryRes = await httpClient('/approvals', { + query: { + module_name: 'TRANSFER_TO_LAYINGS', + module_id: transferToLayingId, + group_step_number: 'false', + page, + limit, + order_by_date: 'ASC', + }, + }); + + return approvalHistoryRes; + } catch (error) { + if (axios.isAxiosError(error)) { + return error.response?.data; + } + + return undefined; + } + } } export const TransferToLayingApi = new TransferToLayingService(