mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Fix double DB request in 'RegistrationSlideInvite'
This commit is contained in:
parent
c26ee9df3a
commit
f3aa5afa81
@ -48,6 +48,7 @@ export default {
|
||||
message: this.$t('components.enter-invite.form.validations.length'),
|
||||
},
|
||||
},
|
||||
dbRequestInProgress: false,
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
@ -102,8 +103,10 @@ export default {
|
||||
const { inviteCode } = this.sliderData.collectedInputData
|
||||
const variables = { code: inviteCode }
|
||||
|
||||
if (!this.isVariablesRequested(variables)) {
|
||||
if (!this.isVariablesRequested(variables) && !this.dbRequestInProgress) {
|
||||
try {
|
||||
this.dbRequestInProgress = true
|
||||
|
||||
const response = await this.$apollo.query({ query: isValidInviteCodeQuery, variables })
|
||||
this.sliderData.setSliderValuesCallback(null, {
|
||||
sliderData: {
|
||||
@ -127,6 +130,8 @@ export default {
|
||||
|
||||
const { message } = err
|
||||
this.$toast.error(message)
|
||||
} finally {
|
||||
this.dbRequestInProgress = false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user