Updated partner project listing to use returned data
This commit is contained in:
@@ -810,6 +810,7 @@ export const updateActivity = async (payload: UpdateActivityRequest): Promise<Ac
|
||||
: null;
|
||||
|
||||
const body = {
|
||||
activityId: toIntegerId(payload.activityId),
|
||||
projectId: toIntegerId(payload.projectId),
|
||||
milestoneId: toNullableIntegerId(payload.milestoneId),
|
||||
category: payload.category || 'Operations',
|
||||
@@ -830,6 +831,46 @@ export const updateActivity = async (payload: UpdateActivityRequest): Promise<Ac
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export const submitActivityForApproval = async (
|
||||
activity: Activity,
|
||||
projectId: number | string,
|
||||
evidences?: Evidence[]
|
||||
): Promise<void> => {
|
||||
if (evidences && evidences.length > 0) {
|
||||
for (const ev of evidences) {
|
||||
if (Number(ev.status) === ApprovalStatus.Pending) {
|
||||
try {
|
||||
await updateEvidence({
|
||||
evidenceId: ev.id,
|
||||
version: ev.version || 1,
|
||||
evidenceType: (ev as any).evidenceType ?? ev.type,
|
||||
status: ApprovalStatus.Review,
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn('Could not update evidence status', ev.id, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await updateActivity({
|
||||
activityId: activity.id,
|
||||
projectId,
|
||||
milestoneId: activity.milestoneId,
|
||||
category: activity.category || 'Operations',
|
||||
amount: activity.amount || 0,
|
||||
title: activity.title || 'Activity',
|
||||
description: activity.description || '',
|
||||
performedAt: new Date().toISOString(),
|
||||
status: ApprovalStatus.Review,
|
||||
});
|
||||
} catch (e) {
|
||||
console.warn('Could not update activity fulfillment record', e);
|
||||
}
|
||||
};
|
||||
|
||||
export const getMilestones = async (projectId: string | number): Promise<Milestone[]> => {
|
||||
const hashedProjectId = await toolsService.resolveProjectId(projectId);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user