mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 07:15:44 +00:00
feat(FE-181-179-220): Slicing UI, Client Side Validation and API Integration for Delivery Order
This commit is contained in:
@@ -8,13 +8,10 @@ import {
|
||||
BaseApiResponse,
|
||||
BaseGroupedApproval,
|
||||
ErrorApiResponse,
|
||||
GroupedApprovals,
|
||||
SuccessApiResponse,
|
||||
} from '@/types/api/api-general';
|
||||
import { sleep } from '@/lib/helper';
|
||||
import { httpClient } from '@/services/http/client';
|
||||
import axios from 'axios';
|
||||
import { Flock } from '@/types/api/master-data/flock';
|
||||
import { Kandang } from '@/types/api/master-data/kandang';
|
||||
import { RequestOptions } from '@/services/http/base';
|
||||
|
||||
@@ -104,25 +101,34 @@ export class ProjectFlockService extends BaseApiService<
|
||||
/**
|
||||
* Get Next Period of Project Flock
|
||||
*/
|
||||
async getNextPeriod(id: string): Promise<
|
||||
| BaseApiResponse<{
|
||||
flock: Flock;
|
||||
next_period: number;
|
||||
}>
|
||||
async getNextPeriod(locationId: number): Promise<
|
||||
| BaseApiResponse<
|
||||
{
|
||||
id: number;
|
||||
name: string;
|
||||
period: number;
|
||||
}[]
|
||||
>
|
||||
| ErrorApiResponse
|
||||
| SuccessApiResponse<{
|
||||
flock: Flock;
|
||||
next_period: number;
|
||||
}>
|
||||
| SuccessApiResponse<
|
||||
{
|
||||
id: number;
|
||||
name: string;
|
||||
period: number;
|
||||
}[]
|
||||
>
|
||||
| undefined
|
||||
> {
|
||||
try {
|
||||
const path = `${this.basePath}/kandangs/${id}`;
|
||||
const path = `${this.basePath}/kandangs/${locationId.toString()}/periods`;
|
||||
return await httpClient<
|
||||
SuccessApiResponse<{
|
||||
flock: Flock;
|
||||
next_period: number;
|
||||
}>
|
||||
SuccessApiResponse<
|
||||
{
|
||||
id: number;
|
||||
name: string;
|
||||
period: number;
|
||||
}[]
|
||||
>
|
||||
>(path, {
|
||||
method: 'GET',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user