added cargoType
This commit is contained in:
@@ -3,19 +3,26 @@ import { CommonResponseType, PageAble } from '@/helpers/types';
|
||||
import { request } from '@/services/request';
|
||||
|
||||
export const party_requests = {
|
||||
async getAll(params?: { page?: number; sort?: string; direction?: string; partyName?: string; status?: PartyStatus }) {
|
||||
async getAll(params?: {
|
||||
page?: number;
|
||||
sort?: string;
|
||||
direction?: string;
|
||||
partyName?: string;
|
||||
status?: PartyStatus;
|
||||
cargoType?: 'AUTO' | 'AVIA';
|
||||
}) {
|
||||
return request.get<CommonResponseType<PageAble<Party>>>('/parties/list', { params });
|
||||
},
|
||||
async changeStatus(params: { partyId: string | number; status: PartyStatus }) {
|
||||
return request.put('/parties/change', undefined, { params });
|
||||
},
|
||||
async create(body: { name: string }) {
|
||||
async create(body: { name: string; cargoType: 'AUTO' | 'AVIA' }) {
|
||||
return request.post<CommonResponseType>('/parties/create', body);
|
||||
},
|
||||
async update(body: { id: number | string; name: string }) {
|
||||
async update(body: { id: number | string; name: string; cargoType: 'AUTO' | 'AVIA' }) {
|
||||
return request.put<CommonResponseType<Party[]>>(
|
||||
'/parties/update',
|
||||
{ name: body.name },
|
||||
{ name: body.name, cargoType: body.cargoType },
|
||||
{
|
||||
params: {
|
||||
partyId: body.id,
|
||||
|
||||
Reference in New Issue
Block a user