diff --git a/src/services/feature-api.js b/src/services/feature-api.js index f933884cc70b32d9fca07e5ec5331950a1b31ae6..d5e6c4271b53ff52ab0e3adc52c7c5ac0fa9785a 100644 --- a/src/services/feature-api.js +++ b/src/services/feature-api.js @@ -37,7 +37,12 @@ const featureAPI = { }, async getPaginatedFeatures(url) { - const response = await axios.get(url); + // Cancel any ongoing search request. + store.dispatch('CANCEL_CURRENT_SEARCH_REQUEST'); + // Prepare the cancel token for the new request and store it. + const cancelToken = axios.CancelToken.source(); + store.commit('SET_CANCELLABLE_SEARCH_REQUEST', cancelToken); + const response = await axios.get(url, { cancelToken: cancelToken.token }); if ( response.status === 200 && response.data diff --git a/src/store/index.js b/src/store/index.js index ff20b3c0d7a59b47b97f40634b52b212d0caf29d..9b33b67bc76b0bdb2abd3d8448498ae6d2f00828 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -156,7 +156,7 @@ export default new Vuex.Store({ password: payload.password, }) .then((response) => { - if (response.status === 201 && response.data) { + if (response.status === 200 && response.data) { commit('SET_USER', response.data.user); dispatch('REDIRECT_AFTER_LOGIN'); dispatch('GET_USER_LEVEL_PROJECTS'); diff --git a/src/views/Login.vue b/src/views/Login.vue index c8c837bc64335499b6124fbf4d63a8854957f4a6..9dcde154dd52acdc5b656a43f357a3dd16c22f13 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -397,9 +397,9 @@ export default { const ssoResponse = await userAPI.signup({ ...this.signupForm, // Ajout du label personnalisé pour affichage plus précis dans admin OGS - "comments": `{"${this.commentsFieldLabel}":"${this.signupForm.comments}"}`, + comments: `{"${this.commentsFieldLabel}":"${this.signupForm.comments}"}`, // Pour permettre la visualisation dans OGS Maps, l'utilisateur doit être ajouté à un groupe OGS, mis en dur pour aller vite pour l'instant - "usergroup_roles":[{"organisation":{"id":1}}] + usergroup_roles:[{ organisation: { id: 1 } }] }, this.ssoSignupUrl); if (ssoResponse.status !== 201) {