diff --git a/src/admin/components/lists/items-list.vue b/src/admin/components/lists/items-list.vue index ebf49875c..f18495f9b 100644 --- a/src/admin/components/lists/items-list.vue +++ b/src/admin/components/lists/items-list.vue @@ -26,7 +26,7 @@ - {{ $i18n.get('label_delete_selected_items') }} + {{ isOnTrash ? $i18n.get('label_delete_permanently') : $i18n.get('label_send_to_trash') }} {{ $i18n.get('label_edit_selected_items') + ' (Not ready)' }} diff --git a/src/admin/tainacan-admin-i18n.php b/src/admin/tainacan-admin-i18n.php index 91803a372..619fadbbf 100644 --- a/src/admin/tainacan-admin-i18n.php +++ b/src/admin/tainacan-admin-i18n.php @@ -202,7 +202,8 @@ return apply_filters('tainacan-admin-i18n',[ 'label_bulk_actions' => __( 'Bulk actions', 'tainacan' ), 'label_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ), 'label_edit_selected_collections' => __( 'Edit selected collections', 'tainacan' ), - 'label_delete_selected_items' => __( 'Delete selected items', 'tainacan' ), + 'label_delete_permanently' => __( 'Delete permanently', 'tainacan' ), + 'label_send_to_trash' => __( 'Send to trash', 'tainacan' ), 'label_delete_selected_taxonomies' => __( 'Delete selected taxonomies', 'tainacan' ), 'label_edit_selected_items' => __( 'Edit selected items', 'tainacan' ), 'label_edit_selected_taxonomies' => __( 'Edit selected taxonomies', 'tainacan' ), diff --git a/src/js/store/modules/collection/actions.js b/src/js/store/modules/collection/actions.js index c64e118a5..0e22e1558 100644 --- a/src/js/store/modules/collection/actions.js +++ b/src/js/store/modules/collection/actions.js @@ -79,8 +79,12 @@ export const fetchItems = ({ rootGetters, dispatch, commit }, { collectionId, is export const deleteItem = ({ commit }, { itemId, isPermanently }) => { return new Promise((resolve, reject) => { let endpoint = '/items/' + itemId; - if (isPermanently) - endpoint = endpoint + '?permanently=1' + + if (isPermanently){ + endpoint = endpoint + '?permanently=1'; + } else { + endpoint = endpoint + '?permanently=0'; + } axios.tainacan.delete(endpoint) .then( res => { @@ -147,8 +151,11 @@ export const fetchCollectionName = ({ commit }, id) => { export const deleteCollection = ({ commit }, { collectionId, isPermanently }) => { return new Promise((resolve, reject) => { let endpoint = '/collections/' + collectionId; - if (isPermanently) - endpoint = endpoint + '?permanently=true' + if (isPermanently){ + endpoint = endpoint +'?permanently=1'; + } else { + endpoint = endpoint +'?permanently=0'; + } axios.tainacan.delete(endpoint) .then(res => { diff --git a/src/js/store/modules/taxonomy/actions.js b/src/js/store/modules/taxonomy/actions.js index d69175be9..26d35b6b3 100644 --- a/src/js/store/modules/taxonomy/actions.js +++ b/src/js/store/modules/taxonomy/actions.js @@ -25,7 +25,7 @@ export const createTaxonomy = ({commit}, taxonomy) => { export const deleteTaxonomy = ({ commit }, taxonomyId) => { return new Promise(( resolve, reject ) => { - axios.tainacan.delete(`/taxonomies/${taxonomyId}?permanently=${true}`) + axios.tainacan.delete(`/taxonomies/${taxonomyId}?permanently=1`) .then(res => { commit('deleteTaxonomy', res.data); @@ -139,7 +139,7 @@ export const sendTerm = ({commit}, { taxonomyId, name, description, parent, head export const deleteTerm = ({ commit }, { taxonomyId, termId }) => { return new Promise(( resolve, reject ) => { - axios.tainacan.delete(`/taxonomy/${taxonomyId}/terms/${termId}?permanently=${true}`) + axios.tainacan.delete(`/taxonomy/${taxonomyId}/terms/${termId}?permanently=1`) .then(res => { let term = res.data; commit('deleteTerm', termId);