Skip to content

Commit

Permalink
#17144: Duplicate name request issue. (#716)
Browse files Browse the repository at this point in the history
* Duplicate name request issue.#17144 : created query to lookup user data, created exception to catch error for duplicates

* Duplicate name request issue.#17144 : version update

* updated error

* Duplicate name request issue.#17144 : version update

* removed trailing saces, updated wording

* Updated message acc to UX message

* version updated

* version

* version format update

---------

Co-authored-by: Rajandeep98 <root@NI502174.idir.BCGOV>
Co-authored-by: eve-git <54647458+eve-git@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 20, 2023
1 parent 63b4748 commit 3a99da9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "name-request",
"version": "5.2.15",
"version": "5.3.0",
"private": true,
"appName": "Name Request UI",
"sbcName": "SBC Common Components",
Expand Down
13 changes: 13 additions & 0 deletions src/components/dialogs/error.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
For assistance, please contact BC Registries staff:
</v-card-text>
</div>
<div v-else-if="isExists">
<v-card-text class="copy-normal pt-8">
You have already created an identical name request. To request a different name, please go back and change the name to request and try again.
<br>
<br>
For assistance, please contact BC Registries staff:
</v-card-text>
</div>
<div v-else>
<v-card-text class="copy-normal pt-8">
If you have paid for a new NR, please do not try submitting your payment again.
Expand Down Expand Up @@ -70,6 +78,11 @@ export default class ErrorDialog extends Vue {
await ErrorModule.clearAppErrors()
}
get isExists () {
const errors = ErrorModule[ErrorTypes.GET_ERRORS]
return errors[0] && errors[0].id === 'entry-already-exists'
}
get isEditLockError () {
const errors = ErrorModule[ErrorTypes.GET_ERRORS]
return errors[0] && errors[0].id === 'edit-lock-error'
Expand Down
6 changes: 5 additions & 1 deletion src/services/namex-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,11 @@ export default class NamexServices {
err?.response && console.log('postNameRequest(), response =', err.response) // eslint-disable-line no-console
const msg = await this.handleApiError(err, 'Could not post name requests')
console.error('postNameRequest() =', msg) // eslint-disable-line no-console
await errorModule.setAppError({ id: 'post-name-requests-error', error: msg } as ErrorI)
let error_id = 'post-name-requests-error'
if (err instanceof AxiosError && err.response.data.message === 'The request with same name is already submitted.') {
error_id = 'entry-already-exists'
}
await errorModule.setAppError({ id: error_id, error: msg } as ErrorI)
return null
}
}
Expand Down

0 comments on commit 3a99da9

Please sign in to comment.