If you're not sure, you can inactivate this account instead.`,
'the_journal_has_been_successfully_created': 'The journal #{number} has been successfully created.',
'the_journal_has_been_successfully_edited': 'The journal #{number} has been successfully edited.',
+ 'the_journal_has_been_successfully_deleted': 'The journal #{number} has been successfully deleted.',
+ 'the_journals_has_been_successfully_deleted': 'The journals {count} have been successfully deleted.',
'credit': 'Credit',
'debit': 'Debit',
'once_delete_this_item_you_will_able_to_restore_it': `Once you delete this item, you won\'t be able to restore the item later. Are you sure you want to delete ?
If you're not sure, you can inactivate it instead.`,
@@ -192,4 +197,10 @@ export default {
'the_custom_view_has_been_successfully_deleted': 'The custom view has been successfully deleted.',
'teammate_invited_to_organization_account': 'Your teammate has been invited to the organization account.',
'select_account_type': 'Select account type',
+ 'the_item_category_has_been_successfully_deleted': 'The item category has been successfully deleted.',
+ 'once_delete_this_item_category_you_will_able_to_restore_it': 'Once you delete this item category, you won\'t be able to restore the item later. Are you sure you want to delete?',
+ 'once_delete_this_journal_category_you_will_able_to_restore_it': 'Once you delete this journal, you won\'t be able to restore the item later. Are you sure you want to delete?',
+ 'all': 'All',
+ 'once_delete_these_journalss_you_will_not_able_restore_them': 'Once you delete these journals, you won\'t be able to retrieve them later. Are you sure you want to delete them?',
+ 'journal_number_is_already_used': 'Journal number is already used.',
};
diff --git a/client/src/store/Invite/invite.action.js b/client/src/store/Invite/invite.action.js
deleted file mode 100644
index d0bae2d6f..000000000
--- a/client/src/store/Invite/invite.action.js
+++ /dev/null
@@ -1,14 +0,0 @@
-
-import ApiService from 'services/ApiService';
-
-export const submitInvite = ({ form, token }) => {
- return (dispatch) => {
- return ApiService.post(`/invite/accept/${token}`, { ...form });
- };
-};
-
-export const submitSendInvite = ({ form }) => {
- return (dispatch) => {
- return ApiService.post('invite', { form });
- };
-};
diff --git a/client/src/store/itemCategories/itemsCategory.actions.js b/client/src/store/itemCategories/itemsCategory.actions.js
index ee89b47d6..b12d63f1c 100644
--- a/client/src/store/itemCategories/itemsCategory.actions.js
+++ b/client/src/store/itemCategories/itemsCategory.actions.js
@@ -7,7 +7,7 @@ export const submitItemCategory = ({ form }) => {
};
};
-export const fetchItemCategories = () => {
+export const fetchItemCategories = ({ query }) => {
return (dispatch, getState) => new Promise((resolve, reject) => {
dispatch({
type: t.SET_DASHBOARD_REQUEST_LOADING,
@@ -18,7 +18,7 @@ export const fetchItemCategories = () => {
loading: true,
}
});
- ApiService.get('item_categories')
+ ApiService.get('item_categories', { params: { ...query } })
.then((response) => {
dispatch({
type: t.ITEMS_CATEGORY_LIST_SET,
@@ -70,7 +70,7 @@ export const deleteItemCategory = (id) => {
.then((response) => {
dispatch({
type: t.CATEGORY_DELETE,
- id,
+ payload: { id },
});
resolve(response);
})
diff --git a/client/src/store/itemCategories/itemsCategory.reducer.js b/client/src/store/itemCategories/itemsCategory.reducer.js
index cfd73ea52..7d5f3f25c 100644
--- a/client/src/store/itemCategories/itemsCategory.reducer.js
+++ b/client/src/store/itemCategories/itemsCategory.reducer.js
@@ -24,8 +24,10 @@ export default createReducer(initialState, {
},
[t.CATEGORY_DELETE]: (state, action) => {
- if (typeof state.categories[action.id] !== 'undefined') {
- delete state.categories[action.id];
+ const { id } = action.payload;
+
+ if (typeof state.categories[id] !== 'undefined') {
+ delete state.categories[id];
}
},
diff --git a/client/src/store/itemCategories/itemsCateory.reducer.js b/client/src/store/itemCategories/itemsCateory.reducer.js
index 3246368ae..a484472d4 100644
--- a/client/src/store/itemCategories/itemsCateory.reducer.js
+++ b/client/src/store/itemCategories/itemsCateory.reducer.js
@@ -20,8 +20,12 @@ export default createReducer(initialState, {
},
[t.CATEGORY_DELETE]: (state, action) => {
- if (typeof state.categories[action.id] !== 'undefined') {
- delete state.categories[action.id];
+ const { id } = action.payload;
+ const categories = { ...state.categories };
+
+ if (typeof categories[id] !== 'undefined') {
+ delete categories[id];
+ state.categories = categories;
}
}
});
diff --git a/client/src/store/items/items.actions.js b/client/src/store/items/items.actions.js
index a179fe2cf..bbb1a3eef 100644
--- a/client/src/store/items/items.actions.js
+++ b/client/src/store/items/items.actions.js
@@ -65,5 +65,14 @@ export const fetchItem = ({ id }) => {
};
export const deleteItem = ({ id }) => {
- return dispatch => ApiService.delete(`items/${id}`);
+ return dispatch => new Promise((resolve, reject) => {
+ ApiService.delete(`items/${id}`)
+ .then((response) => {
+ dispatch({
+ type: t.ITEM_DELETE,
+ payload: { id },
+ });
+ resolve(response);
+ }).catch((error) => { reject(error); });
+ });
};
diff --git a/client/src/store/items/items.reducer.js b/client/src/store/items/items.reducer.js
index 15a99a146..25fecd60e 100644
--- a/client/src/store/items/items.reducer.js
+++ b/client/src/store/items/items.reducer.js
@@ -77,14 +77,14 @@ const itemsReducer = createReducer(initialState, {
},
[t.ITEM_DELETE]: (state, action) => {
- const { itemId } = action;
+ const { id } = action.payload;
+ const items = { ...state.items };
- if (state.items[itemId]) {
- const item = state.items[itemId];
- const itemPageNumber = item._page_number;
-
- delete state.items[itemId];
+ if (items[id]) {
+ const item = items[id];
+ delete items[id];
+ state.items = items;
}
},
diff --git a/client/src/style/pages/manual-journals.scss b/client/src/style/pages/manual-journals.scss
index 847ff7e5e..7b70b850e 100644
--- a/client/src/style/pages/manual-journals.scss
+++ b/client/src/style/pages/manual-journals.scss
@@ -23,7 +23,6 @@
}
.status{
font-size: 13px;
- text-transform: uppercase;
}
}
}
diff --git a/server/src/http/controllers/ItemCategories.js b/server/src/http/controllers/ItemCategories.js
index 6563b8612..b3da48ecc 100644
--- a/server/src/http/controllers/ItemCategories.js
+++ b/server/src/http/controllers/ItemCategories.js
@@ -180,7 +180,7 @@ export default {
getList: {
validation: [
query('column_sort_order').optional().trim().escape(),
- query('sort_order').optional().isInt(['desc', 'asc']),
+ query('sort_order').optional().trim().escape().isIn(['desc', 'asc']),
query('stringified_filter_roles').optional().isJSON(),
],
async handler(req, res) {