axios .patch(`${baseURI}auth/users/${encodeURIComponent(username)}`, requestPayload) .then((json = {}) => json.data)
axios .patch(`${baseURI}api/settings`, settings) .then((json = {}) => json.data) .then( data => { AppDispatcher.dispatchServerAction({ type: ActionTypes.SETTINGS_SAVE_REQUEST_SUCCESS, data, options, }); }, error => { AppDispatcher.dispatchServerAction({ type: ActionTypes.SETTINGS_SAVE_REQUEST_ERROR, error, }); }, )
axios .patch(`${baseURI}api/client/settings`, settings) .then((json = {}) => json.data) .then( data => { AppDispatcher.dispatchServerAction({ type: ActionTypes.CLIENT_SETTINGS_SAVE_SUCCESS, data, options, }); }, error => { AppDispatcher.dispatchServerAction({ type: ActionTypes.CLIENT_SETTINGS_SAVE_ERROR, error, options, }); }, )
axios .patch(`${baseURI}api/client/torrents/${hash}/priority`, { hash, priority, }) .then((json = {}) => json.data) .then( data => { AppDispatcher.dispatchServerAction({ type: ActionTypes.CLIENT_SET_TORRENT_PRIORITY_SUCCESS, data, }); }, error => { AppDispatcher.dispatchServerAction({ type: ActionTypes.CLIENT_SET_TORRENT_PRIORITY_ERROR, error, }); }, )
axios .patch(`${baseURI}api/client/torrents/taxonomy`, { hashes, tags, options, }) .then((json = {}) => json.data) .then( data => { AppDispatcher.dispatchServerAction({ type: ActionTypes.CLIENT_SET_TAXONOMY_SUCCESS, data, }); }, error => { AppDispatcher.dispatchServerAction({ type: ActionTypes.CLIENT_SET_TAXONOMY_ERROR, error, }); }, )
axios .patch(`${baseURI}api/client/torrents/${hash}/file-priority`, { hash, fileIndices, priority, }) .then((json = {}) => json.data) .then( data => { AppDispatcher.dispatchServerAction({ type: ActionTypes.CLIENT_SET_FILE_PRIORITY_SUCCESS, data: { ...data, hash, fileIndices, priority, }, }); }, error => { AppDispatcher.dispatchServerAction({ type: ActionTypes.CLIENT_SET_FILE_PRIORITY_ERROR, error, }); }, )
changeQuestionnaireEachStatus({commit, state}, param) { return new Promise((resolve, reject) => { axios.patch(`${bus.host}/questionnaireEach/${param.id}/status`, {status: param.status}) .then(function ({data}) { resolve(data); }) .catch(function (error) { resolve(); }); }); }
const updateEvent = (data) => { return axios.patch(`/api/events/${data.get('id')}`, data, { headers: { 'accept': 'application/json', 'Accept-Language': 'en-US,en;q=0.8', 'Content-Type': `multipart/form-data; boundary=${data._boundary}`, } }) }
const submitProposal = (proposalData) => async (dispatch) => { console.log(proposalData); try { const res = await axios.patch(`${BASE_URL}/proposal/change/${proposalData.proposalId}`, proposalData); dispatch(setRequestStatus(false)); if (res.status === 200) { dispatch(setRequestStatus(true)); } } catch (error) { dispatch(errorHandler(error)); } }
const updatePost = (postId, updatedInfo) => async (dispatch) => { try { console.log('updatedPostInfo ', updatedInfo) const res = await axios.patch(`${BASE_URL}/post/${postId}`, updatedInfo) if (res.status === 200) { dispatch(getPostById(postId)) } } catch (error) { dispatch(errorHandler(error)) } }
const upVotePost = (postId) => async (dispatch) => { try { const res = await axios.patch(`${BASE_URL}/post/upvote/${postId}`) if(res.status === 200) { console.log('successfully upvoted post ', res.data) dispatch(getAllPosts()); } } catch (error) { dispatch(errorHandler(error)) } }
removeTemplateById({commit, state}, {templateId, index}) { return new Promise((resolve, reject) => { axios.patch(`${bus.host}/questionnaireTemplate/${templateId}/remove`) .then(function ({data}) { commit('removeTemplateById', {index}); resolve(null, data); }) .catch(function (error) { resolve(error); }); }); }
/** * Send request using PATCH method * * @param {string} endpoint Endpoint path in format `socket-name/endpoint-name` * @param {any} [data={}] Additional request parameters * @param {axios.AxiosRequestConfig} [options={}] Additional request options, like headers. See axios config for info * @see https://github.com/axios/axios#request-config */ public patch(endpoint: string, data?: any, options?: axios.AxiosRequestConfig) { this.checkInstanceName() return request.patch(this.url(endpoint), data || {}, this.options(options)).then(this.transform) }
const activateDeactivateToggler = () => async (dispatch) => { try { const res = await axios.patch(`${BASE_URL}/user/deactivate/toggler`) if (res.status === 200) { console.log('Deactivation toggler', res.data); dispatch(getProfile()); } } catch (error) { dispatch(errorHandler(error)) } }
removeTemplateById({commit, state}, {templateId, index}) { return new Promise((resolve, reject) => { axios.patch(`${bus.host}/questionnaireTemplate/${templateId}/remove`) .then(function ({data}) { commit('removeTemplateById', {index}); resolve(null, data); }) .catch(function (error) { resolve(error); }); }); }