Add RetailPrice and AgencyMarginPercent to PriceListItem and related API updates
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { api } from '@/lib/api'
|
||||
import type { PaginatedResponse, SupplierResponse } from '@/types/api'
|
||||
import type { PageParams } from './master'
|
||||
import type { SupplierResponse } from '@/types/api'
|
||||
|
||||
export interface SupplierBody {
|
||||
name: string
|
||||
@@ -9,8 +8,8 @@ export interface SupplierBody {
|
||||
}
|
||||
|
||||
export const suppliers = {
|
||||
list: (params?: PageParams) =>
|
||||
api.get<PaginatedResponse<SupplierResponse>>('/suppliers', { params }).then(r => r.data),
|
||||
list: () =>
|
||||
api.get<SupplierResponse[]>('/suppliers').then(r => r.data),
|
||||
|
||||
get: (id: string) =>
|
||||
api.get<SupplierResponse>(`/suppliers/${id}`).then(r => r.data),
|
||||
@@ -20,4 +19,7 @@ export const suppliers = {
|
||||
|
||||
update: (id: string, body: Partial<SupplierBody>) =>
|
||||
api.put<SupplierResponse>(`/suppliers/${id}`, body).then(r => r.data),
|
||||
|
||||
remove: (id: string) =>
|
||||
api.delete(`/suppliers/${id}`),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user