Add RetailPrice and AgencyMarginPercent to PriceListItem and related API updates

This commit is contained in:
2026-09-09 16:32:57 +05:30
parent 9bb4c52efb
commit 6c6d30f4f9
4 changed files with 49 additions and 21 deletions
+6 -4
View File
@@ -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}`),
}