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'),
|
message: this.$t('components.enter-invite.form.validations.length'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
dbRequestInProgress: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
@ -102,8 +103,10 @@ export default {
|
|||||||
const { inviteCode } = this.sliderData.collectedInputData
|
const { inviteCode } = this.sliderData.collectedInputData
|
||||||
const variables = { code: inviteCode }
|
const variables = { code: inviteCode }
|
||||||
|
|
||||||
if (!this.isVariablesRequested(variables)) {
|
if (!this.isVariablesRequested(variables) && !this.dbRequestInProgress) {
|
||||||
try {
|
try {
|
||||||
|
this.dbRequestInProgress = true
|
||||||
|
|
||||||
const response = await this.$apollo.query({ query: isValidInviteCodeQuery, variables })
|
const response = await this.$apollo.query({ query: isValidInviteCodeQuery, variables })
|
||||||
this.sliderData.setSliderValuesCallback(null, {
|
this.sliderData.setSliderValuesCallback(null, {
|
||||||
sliderData: {
|
sliderData: {
|
||||||
@ -127,6 +130,8 @@ export default {
|
|||||||
|
|
||||||
const { message } = err
|
const { message } = err
|
||||||
this.$toast.error(message)
|
this.$toast.error(message)
|
||||||
|
} finally {
|
||||||
|
this.dbRequestInProgress = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user