feat(convert): show convert requests under hesab ketab
Admins review pending cathode-to-wire requests in the shared table, and on mobile they see cards. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import useAxios from '@core/utils/useAxios'
|
||||
|
||||
export interface CopperConvertRequestRow {
|
||||
id: number
|
||||
status: 'pending' | 'approved' | 'rejected' | string
|
||||
source: string
|
||||
customer_name: string
|
||||
customer_mobile: string
|
||||
asset_unit: string
|
||||
consumed_amount: number
|
||||
leftover_amount: number
|
||||
source_unit_price: number
|
||||
wire15_rings: number
|
||||
wire15_unit_price: number
|
||||
wire25_rings: number
|
||||
wire25_unit_price: number
|
||||
created_at?: string
|
||||
}
|
||||
|
||||
export const getCopperConvertRequests = () =>
|
||||
useAxios.get<CopperConvertRequestRow[]>('/admin/copper-convert-request')
|
||||
|
||||
export const approveCopperConvertRequest = (id: number) =>
|
||||
useAxios.post(`/admin/copper-convert-request/${id}/approve`)
|
||||
|
||||
export const rejectCopperConvertRequest = (id: number) =>
|
||||
useAxios.post(`/admin/copper-convert-request/${id}/reject`)
|
||||
Reference in New Issue
Block a user