mirror of
https://github.com/strapi/strapi.git
synced 2025-12-27 15:13:21 +00:00
Clean code
This commit is contained in:
parent
127179cd76
commit
c8492a6b11
@ -77,7 +77,7 @@ export class ListPage extends React.Component {
|
||||
location: { pathname, search },
|
||||
} = prevProps;
|
||||
const {
|
||||
listPage: { deleteAllSuccess, filtersUpdated },
|
||||
listPage: { filtersUpdated },
|
||||
} = this.props;
|
||||
|
||||
if (pathname !== this.props.location.pathname) {
|
||||
@ -89,10 +89,6 @@ export class ListPage extends React.Component {
|
||||
this.getData(this.props);
|
||||
}
|
||||
|
||||
if (prevProps.listPage.deleteAllSuccess !== deleteAllSuccess) {
|
||||
this.getData(this.props);
|
||||
}
|
||||
|
||||
if (prevProps.listPage.filtersUpdated !== filtersUpdated) {
|
||||
const updatedSearch = this.generateSearch();
|
||||
this.props.history.push({ pathname, search: updatedSearch });
|
||||
|
||||
@ -30,7 +30,6 @@ import {
|
||||
const initialState = fromJS({
|
||||
appliedFilters: List([]),
|
||||
count: 0,
|
||||
deleteAllSuccess: false,
|
||||
entriesToDelete: List([]),
|
||||
filters: List([]),
|
||||
filtersUpdated: false,
|
||||
@ -64,8 +63,7 @@ function listPageReducer(state = initialState, action) {
|
||||
case DELETE_SEVERAL_DATA_SUCCESS:
|
||||
return state
|
||||
.update('showWarningDeleteAll', () => false)
|
||||
.update('entriesToDelete', () => List([]))
|
||||
.update('deleteAllSuccess', v => v = !v);
|
||||
.update('entriesToDelete', () => List([]));
|
||||
case CHANGE_PARAMS:
|
||||
return state.updateIn(action.keys, () => action.value);
|
||||
case GET_DATA_SUCCEEDED:
|
||||
|
||||
@ -101,6 +101,7 @@ export function* dataDeleteAll({ entriesToDelete, model, source }) {
|
||||
});
|
||||
|
||||
yield put(deleteSeveralDataSuccess());
|
||||
yield call(dataGet, { currentModel: model, source });
|
||||
} catch(err) {
|
||||
strapi.notification.error('content-manager.error.record.delete');
|
||||
}
|
||||
|
||||
@ -1,9 +1 @@
|
||||
{
|
||||
"product": {
|
||||
"attributes": {
|
||||
"name": {
|
||||
"appearance": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
||||
@ -8,8 +8,6 @@ module.exports = {
|
||||
for (const value in where.value) {
|
||||
qb[value ? 'where' : 'orWhere'](key, where.symbol, where.value[value]);
|
||||
}
|
||||
// } else if (where.symbol === 'IN') {
|
||||
// qb.whereIn(key, where.value);
|
||||
} else {
|
||||
qb.where(key, where.symbol, where.value);
|
||||
}
|
||||
|
||||
@ -38,10 +38,6 @@
|
||||
"via": "users",
|
||||
"plugin": "users-permissions",
|
||||
"configurable": false
|
||||
},
|
||||
"products": {
|
||||
"collection": "product",
|
||||
"via": "user"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user