diff --git a/auth-web/src/store/modules/staff.ts b/auth-web/src/store/modules/staff.ts index d283e7949e..b07d115098 100644 --- a/auth-web/src/store/modules/staff.ts +++ b/auth-web/src/store/modules/staff.ts @@ -194,7 +194,20 @@ export default class StaffModule extends VuexModule { @Action({ rawError: true }) public async syncAccountAffidavit (task: Task): Promise { const taskUserGuid = task?.user?.keycloakGuid - const status = task.relationshipStatus === TaskRelationshipStatus.PENDING_STAFF_REVIEW ? AffidavitStatus.PENDING : task.relationshipStatus + let status = task.relationshipStatus + + switch (task.relationshipStatus) { + case TaskRelationshipStatus.PENDING_STAFF_REVIEW: + status = AffidavitStatus.PENDING + break + case TaskRelationshipStatus.REJECTED: + status = AffidavitStatus.REJECTED + break + default: + status = AffidavitStatus.APPROVED + break + } + const affidavitResponse = await UserService.getAffidavitInfo(taskUserGuid, status) if (affidavitResponse?.data && affidavitResponse?.status === 200) { this.context.commit('setAccountUnderReviewAffidavitInfo', affidavitResponse.data) @@ -204,8 +217,9 @@ export default class StaffModule extends VuexModule { @Action({ rawError: true }) public async approveAccountUnderReview (task:Task) { if (task) { - await TaskService.approvePendingTask(task) - await this.context.dispatch('syncTaskUnderReview', task) + const response = await TaskService.approvePendingTask(task) + const newTask = response.data || task + await this.context.dispatch('syncTaskUnderReview', newTask) } } diff --git a/auth-web/src/views/auth/staff/ReviewAccountView.vue b/auth-web/src/views/auth/staff/ReviewAccountView.vue index b6f0060bae..5326dd24b1 100644 --- a/auth-web/src/views/auth/staff/ReviewAccountView.vue +++ b/auth-web/src/views/auth/staff/ReviewAccountView.vue @@ -351,7 +351,8 @@ export default class ReviewAccountView extends Vue { // both reject and hold will happen here passing second argument to determine which call need to make await this.rejectorOnHoldAccountUnderReview({ task: this.task, isRejecting, remarks: onholdReasons }) } - const taskType: TaskType = TaskType[this.task.type] + const taskType: any = this.task.type + if ([TaskType.GOVM_REVIEW, TaskType.GOVN_REVIEW].includes(taskType)) { await this.createAccountFees(this.task.relationshipId) }