Skip to content

Commit

Permalink
fix: prevent extra patch request on approvals to avoid 401 error
Browse files Browse the repository at this point in the history
  • Loading branch information
EPortman committed Nov 8, 2024
1 parent d08062a commit fab1d06
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "name-examination",
"version": "1.2.35",
"version": "1.2.36",
"private": true,
"scripts": {
"build": "nuxt generate",
Expand Down
7 changes: 0 additions & 7 deletions app/store/examine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,6 @@ export const useExamination = defineStore('examine', () => {
consentDate.value = getDateFromDateTime(parsedConsentDate) ?? undefined
}

// if the current state is not INPROGRESS, HOLD, or DRAFT clear any existing name record in currentNameObj
if (
![Status.InProgress, Status.Hold, Status.Draft].includes(nrStatus.value)
) {
setCurrentNameChoice(undefined)
}

// we keep the original data so that if fields exist that we do not use, we don't lose that
// data when we put new data
clientFirstName.value = info.applicants.clientFirstName ?? undefined
Expand Down
4 changes: 2 additions & 2 deletions testing/cypress/pageObjects/examinePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class ExaminePage {
clickApproveButton() {
cy.intercept('PATCH', '**/api/v1/requests/NR*').as('approvePatchRequest')
cy.get(this.primaryApproveBtn).should('be.visible').click({ force: true })
cy.wait('@approvePatchRequest') // TO_DO: This button is returning a 401
cy.wait('@approvePatchRequest').its('response.statusCode').should('eq', 200)
cy.wait(1000)
}

Expand All @@ -187,7 +187,7 @@ class ExaminePage {
clickQuickApproveButton() {
cy.intercept('PATCH', '**/api/v1/requests/NR*').as('quickApprovePatchRequest')
cy.get(this.quickApproveBtn).should('be.visible').click({ force: true })
cy.wait('@quickApprovePatchRequest') // TO_DO: This button is returning a 401
cy.wait('@quickApprovePatchRequest').its('response.statusCode').should('eq', 200)
cy.wait(1000)
}

Expand Down

0 comments on commit fab1d06

Please sign in to comment.