diff --git a/src/views/admin/components/metadata-types/taxonomy/TainacanTaxonomy.vue b/src/views/admin/components/metadata-types/taxonomy/TainacanTaxonomy.vue index e43e38619..43b648ad0 100644 --- a/src/views/admin/components/metadata-types/taxonomy/TainacanTaxonomy.vue +++ b/src/views/admin/components/metadata-types/taxonomy/TainacanTaxonomy.vue @@ -234,7 +234,7 @@ let val = this.valueComponent; if ((!Array.isArray(val) || val.length == 0) && this.itemMetadatum.metadatum.multiple === 'no') { - tainacanApi.patch(`/item/${this.itemMetadatum.item.id}/metadata/${this.itemMetadatum.metadatum.id}`, { + tainacanApi.put(`/item/${this.itemMetadatum.item.id}/metadata/${this.itemMetadatum.metadatum.id}`, { values: term.id, }).then(() => { this.isAddingNewTermVaue = false; @@ -244,7 +244,7 @@ } else { val = val ? val : []; val.push( this.getComponent == ('tainacan-taxonomy-checkbox' || 'tainacan-taxonomy-radio') ? term.id : {'label': term.name, 'value': term.id} ); - tainacanApi.patch(`/item/${this.itemMetadatum.item.id}/metadata/${this.itemMetadatum.metadatum.id}`, { + tainacanApi.put(`/item/${this.itemMetadatum.item.id}/metadata/${this.itemMetadatum.metadatum.id}`, { values: val, }).then(() => { this.isAddingNewTermVaue = false; diff --git a/src/views/admin/js/store/modules/bgprocess/actions.js b/src/views/admin/js/store/modules/bgprocess/actions.js index 3acb7c65a..0a55e1924 100644 --- a/src/views/admin/js/store/modules/bgprocess/actions.js +++ b/src/views/admin/js/store/modules/bgprocess/actions.js @@ -46,7 +46,7 @@ export const fetchProcesses = ({ commit }, {page, processesPerPage, shouldUpdate export const updateProcess = ({ commit }, { id, status }) => { return new Promise((resolve, reject) => { - axios.tainacanApi.patch(`/bg-processes/${id}/`, { + axios.tainacanApi.put(`/bg-processes/${id}/`, { status: status, }) .then( res => { diff --git a/src/views/admin/js/store/modules/capability/actions.js b/src/views/admin/js/store/modules/capability/actions.js index 4c438234c..eedf6a718 100644 --- a/src/views/admin/js/store/modules/capability/actions.js +++ b/src/views/admin/js/store/modules/capability/actions.js @@ -3,7 +3,7 @@ import axios from '../../../axios' // ROLES export const addCapabilityToRole = ({ commit }, { capabilityKey, role }) => { return new Promise(( resolve, reject ) => { - axios.tainacanApi.patch('/roles/' + role + '?add_cap=' + capabilityKey) + axios.tainacanApi.put('/roles/' + role + '?add_cap=' + capabilityKey) .then( res => { let role = res.data; commit('addCapabilityToRole', {capabilityKey, role }); @@ -17,7 +17,7 @@ export const addCapabilityToRole = ({ commit }, { capabilityKey, role }) => { export const removeCapabilityFromRole = ({ commit }, { capabilityKey, role }) => { return new Promise(( resolve, reject ) => { - axios.tainacanApi.patch('/roles/' + role + '?remove_cap=' + capabilityKey) + axios.tainacanApi.put('/roles/' + role + '?remove_cap=' + capabilityKey) .then( res => { let role = res.data; commit('removeCapabilityFromRole', {capabilityKey, role }); @@ -79,7 +79,7 @@ export const updateRole = ({ commit }, role) => { return new Promise((resolve, reject) => { - axios.tainacanApi.patch('/roles/' + role.slug, role) + axios.tainacanApi.put('/roles/' + role.slug, role) .then(res => { const updatedRole = res.data commit('setRole', updatedRole); diff --git a/src/views/admin/js/store/modules/collection/actions.js b/src/views/admin/js/store/modules/collection/actions.js index 4593cd748..b5ef67b1e 100644 --- a/src/views/admin/js/store/modules/collection/actions.js +++ b/src/views/admin/js/store/modules/collection/actions.js @@ -348,7 +348,7 @@ export const updateCollection = ({ commit }, { collection }) => { return new Promise((resolve, reject) => { - axios.tainacanApi.patch('/collections/' + collection_id + '?context=edit', collection).then( res => { + axios.tainacanApi.put('/collections/' + collection_id + '?context=edit', collection).then( res => { commit('setCollection', collection); resolve( res.data ); }).catch( error => { @@ -416,7 +416,7 @@ export const fetchAttachments = ({ commit }, collection_id) => { export const updateThumbnail = ({ commit }, { collectionId, thumbnailId }) => { return new Promise((resolve, reject) => { - axios.tainacanApi.patch('/collections/' + collectionId + '?context=edit', { + axios.tainacanApi.put('/collections/' + collectionId + '?context=edit', { _thumbnail_id: thumbnailId }).then( res => { let collection = res.data @@ -431,7 +431,7 @@ export const updateThumbnail = ({ commit }, { collectionId, thumbnailId }) => { export const updateHeaderImage = ({ commit }, { collectionId, headerImageId }) => { return new Promise((resolve, reject) => { - axios.tainacanApi.patch('/collections/' + collectionId + '?context=edit', { + axios.tainacanApi.put('/collections/' + collectionId + '?context=edit', { header_image_id: headerImageId + '' }).then( res => { let collection = res.data diff --git a/src/views/admin/js/store/modules/exporter/actions.js b/src/views/admin/js/store/modules/exporter/actions.js index f6b9db814..1d094e160 100644 --- a/src/views/admin/js/store/modules/exporter/actions.js +++ b/src/views/admin/js/store/modules/exporter/actions.js @@ -27,7 +27,7 @@ export const createExporterSession = ({commit}, slug) => { export const updateExporterSession = ({commit}, exporterSessionUpdated) => { return new Promise(( resolve, reject ) => { - tainacanApi.patch(`/exporters/session/${exporterSessionUpdated.id}`, exporterSessionUpdated.body) + tainacanApi.put(`/exporters/session/${exporterSessionUpdated.id}`, exporterSessionUpdated.body) .then(response => { commit('setExporterSession'); resolve( response.data ); diff --git a/src/views/admin/js/store/modules/filter/actions.js b/src/views/admin/js/store/modules/filter/actions.js index d7408e88a..9eff7b307 100644 --- a/src/views/admin/js/store/modules/filter/actions.js +++ b/src/views/admin/js/store/modules/filter/actions.js @@ -128,7 +128,7 @@ export const addTemporaryFilter = ({ commit }, filter ) => { export const updateCollectionFiltersOrder = ({ commit }, { collectionId, filtersOrder }) => { return new Promise((resolve, reject) => { - axios.tainacanApi.patch('/collections/' + collectionId + '/filters_order?context=edit', { + axios.tainacanApi.put('/collections/' + collectionId + '/filters_order?context=edit', { filters_order: filtersOrder }).then( res => { commit('collection/setCollection', res.data, { root: true }); diff --git a/src/views/admin/js/store/modules/item/actions.js b/src/views/admin/js/store/modules/item/actions.js index 39a702cf8..e41f0b032 100644 --- a/src/views/admin/js/store/modules/item/actions.js +++ b/src/views/admin/js/store/modules/item/actions.js @@ -8,7 +8,7 @@ export const updateItemMetadatum = ({ commit }, { item_id, metadatum_id, values, body['parent_meta_id'] = parent_meta_id; return new Promise((resolve, reject) => { - axios.tainacanApi.patch(`/item/${item_id}/metadata/${metadatum_id}`, body) + axios.tainacanApi.put(`/item/${item_id}/metadata/${metadatum_id}`, body) .then( res => { let itemMetadatum = res.data; commit('setSingleMetadatum', itemMetadatum); @@ -45,7 +45,7 @@ export const fetchItemMetadata = ({ commit }, item_id) => { export const fetchCompoundFirstParentMetaId = ({ commit }, { item_id, metadatum_id }) => { return new Promise((resolve, reject) => { - axios.tainacanApi.patch(`/item/${item_id}/metadata/${metadatum_id}`, { value: [] }) + axios.tainacanApi.put(`/item/${item_id}/metadata/${metadatum_id}`, { value: [] }) .then( res => { const parentMetaId = res.data.parent_meta_id; resolve(parentMetaId); @@ -157,7 +157,7 @@ export const sendItem = ( { commit }, item) => { export const updateItem = ({ commit }, item) => { return new Promise((resolve, reject) => { - axios.tainacanApi.patch('/items/' + item.id, item) + axios.tainacanApi.put('/items/' + item.id, item) .then( res => { commit('setItem', res.data); commit('setLastUpdated'); @@ -191,7 +191,7 @@ export const updateItemDocument = ({ commit }, { item_id, document, document_typ params['document_options'] = document_options; return new Promise((resolve, reject) => { - axios.tainacanApi.patch('/items/' + item_id, params).then( res => { + axios.tainacanApi.put('/items/' + item_id, params).then( res => { let item = res.data; commit('setItem', item); @@ -246,7 +246,7 @@ export const sendAttachment = ( { commit }, { item_id, file }) => { export const removeAttachmentFromItem = ( { commit }, attachmentId) => { commit('cleanAttachment'); return new Promise(( resolve, reject ) => { - axios.wpApi.patch('/media/' + attachmentId, { + axios.wpApi.put('/media/' + attachmentId, { post: 0 }) .then( res => { @@ -306,7 +306,7 @@ export const fetchAttachments = ({ commit }, { page, attachmentsPerPage, itemId, export const updateThumbnail = ({ commit }, { itemId, thumbnailId, thumbnailAlt }) => { return new Promise((resolve, reject) => { - axios.tainacanApi.patch('/items/' + itemId, { + axios.tainacanApi.put('/items/' + itemId, { _thumbnail_id: thumbnailId }).then( res => { let item = res.data @@ -322,7 +322,7 @@ export const updateThumbnail = ({ commit }, { itemId, thumbnailId, thumbnailAlt export const updateThumbnailAlt = ({ commit }, { thumbnailId, thumbnailAlt }) => { return new Promise((resolve, reject) => { - axios.wpApi.patch('/media/' + thumbnailId + '?force=true', { + axios.wpApi.put('/media/' + thumbnailId + '?force=true', { alt_text: thumbnailAlt }).then( res => { let thumbnail = res.data; diff --git a/src/views/admin/js/store/modules/metadata/actions.js b/src/views/admin/js/store/modules/metadata/actions.js index f172625c9..15e3fc894 100644 --- a/src/views/admin/js/store/modules/metadata/actions.js +++ b/src/views/admin/js/store/modules/metadata/actions.js @@ -202,7 +202,7 @@ export const cleanMetadata = ({commit}) => { export const updateCollectionMetadataOrder = ({ commit }, { collectionId, metadataOrder, metadataSectionId }) => { return new Promise((resolve, reject) => { - axios.tainacanApi.patch('/collections/' + collectionId + '/metadata_section/' + metadataSectionId + '/metadata_order?context=edit', { + axios.tainacanApi.put('/collections/' + collectionId + '/metadata_section/' + metadataSectionId + '/metadata_order?context=edit', { metadata_order: metadataOrder }).then(res => { commit('collection/setCollection', res.data, { root: true }); @@ -390,7 +390,7 @@ export const updateMetadataSections = ({commit}, metadataSections) => { export const updateCollectionMetadataSectionsOrder = ({ commit }, {collectionId, metadataSectionsOrder }) => { return new Promise((resolve, reject) => { - axios.tainacanApi.patch('/collections/' + collectionId + '/metadata_section_order?context=edit', { + axios.tainacanApi.put('/collections/' + collectionId + '/metadata_section_order?context=edit', { metadata_section_order: metadataSectionsOrder }).then(res => { commit('collection/setCollection', res.data, { root: true }); diff --git a/src/views/admin/js/store/modules/taxonomy/actions.js b/src/views/admin/js/store/modules/taxonomy/actions.js index 768f7f47b..ff13b29b9 100644 --- a/src/views/admin/js/store/modules/taxonomy/actions.js +++ b/src/views/admin/js/store/modules/taxonomy/actions.js @@ -33,7 +33,7 @@ export const deleteTaxonomy = ({ commit }, { taxonomyId, isPermanently }) => { export const updateTaxonomy = ({ commit }, taxonomy) => { return new Promise(( resolve, reject ) => { - axios.tainacanApi.patch(`/taxonomies/${taxonomy.taxonomyId}`, taxonomy) + axios.tainacanApi.put(`/taxonomies/${taxonomy.taxonomyId}`, taxonomy) .then( res => { let taxonomy = res.data; commit('setTaxonomy', taxonomy); @@ -191,7 +191,7 @@ export const updateTerm = ({}, { taxonomyId, term, itemId, metadatumId }) => { term['metadatum_id'] = metadatumId; return new Promise(( resolve, reject ) => { - axios.tainacanApi.patch(`/taxonomy/${taxonomyId}/terms/${term.id}`, term) + axios.tainacanApi.put(`/taxonomy/${taxonomyId}/terms/${term.id}`, term) .then( res => { const updatedTerm = res.data; resolve( updatedTerm ); @@ -254,7 +254,7 @@ export const changeTermsParent = ({}, { taxonomyId, newParentTerm, terms, parent query += `&include=${terms}`; return new Promise(( resolve, reject ) => { - axios.tainacanApi.patch(`/taxonomy/${taxonomyId}/terms/newparent/${newParentTerm}?${query}`) + axios.tainacanApi.put(`/taxonomy/${taxonomyId}/terms/newparent/${newParentTerm}?${query}`) .then(res => { const terms = res.data; resolve( terms );