hurt-tomatoH
Refine3y ago
28 replies
hurt-tomato

Change update patch url

Hello !!
i try to implement the updating password feature. I wrote the updatePasseword in the auth provider like following

 updatePassword: (params) => {
        let url = "";
        let userID: string = "";
        // @ts-ignore
        authProvider.getUserIdentity().then((response) => {
            userID = response.id;
            url = `${UPDATE_URL}${userID}`;
        });
        if (params.password === params.confirmPassword) {
            axiosInstance.patch(url, {password: params.password});
            return Promise.resolve("/offers");
        }
        return Promise.reject();
    },

My issue is that when I click on the update password button, the api call mycmsurl/update-password endpoint and not the url that i specified in the updatePassword function. How can change the api endpoint on save button click ?
Was this page helpful?