mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-21 22:05:45 +00:00
fix(FE): adding capacity to kandang and change confirmation modal marketing with note
This commit is contained in:
@@ -69,7 +69,8 @@ export class SalesOrderService extends BaseApiService<
|
||||
*/
|
||||
async singleApproval(
|
||||
id: number,
|
||||
action: 'APPROVED' | 'REJECTED'
|
||||
action: 'APPROVED' | 'REJECTED',
|
||||
notes?: string
|
||||
): Promise<BaseApiResponse<{ message: string }> | undefined> {
|
||||
try {
|
||||
const path = `${this.basePath}/approvals`;
|
||||
@@ -78,7 +79,7 @@ export class SalesOrderService extends BaseApiService<
|
||||
body: {
|
||||
action: action,
|
||||
approvable_ids: [id],
|
||||
notes: `${action} marketing ${id}`,
|
||||
notes: notes || `${action} marketing ${id}`,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
@@ -92,7 +93,8 @@ export class SalesOrderService extends BaseApiService<
|
||||
*/
|
||||
async bulkApprovals(
|
||||
ids: number[],
|
||||
action: 'APPROVED' | 'REJECTED'
|
||||
action: 'APPROVED' | 'REJECTED',
|
||||
notes?: string
|
||||
): Promise<BaseApiResponse<{ message: string }> | undefined> {
|
||||
try {
|
||||
const path = `${this.basePath}/approvals`;
|
||||
@@ -101,7 +103,7 @@ export class SalesOrderService extends BaseApiService<
|
||||
body: {
|
||||
action: action,
|
||||
approvable_ids: ids,
|
||||
notes: `${action} marketing ${ids.join(', ')}`,
|
||||
notes: notes || `${action} marketing ${ids.join(', ')}`,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
@@ -109,6 +111,29 @@ export class SalesOrderService extends BaseApiService<
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delivery
|
||||
*/
|
||||
async delivery(
|
||||
id: number,
|
||||
notes?: string
|
||||
): Promise<BaseApiResponse<{ message: string }> | undefined> {
|
||||
try {
|
||||
const path = `${this.basePath}/deliveries`;
|
||||
return await httpClient<BaseApiResponse<{ message: string }>>(path, {
|
||||
method: 'POST',
|
||||
body: {
|
||||
action: 'APPROVED',
|
||||
approvable_ids: [id],
|
||||
notes: notes || `Delivery marketing ${id}`,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error delivery marketing:', error);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const SalesOrderApi = new SalesOrderService('/marketing/sales-orders');
|
||||
|
||||
Reference in New Issue
Block a user