Clean code

This commit is contained in:
soupette 2018-06-06 16:49:25 +02:00
parent 127179cd76
commit c8492a6b11
6 changed files with 5 additions and 24 deletions

View File

@ -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 });

View File

@ -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:

View File

@ -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');
}

View File

@ -1,9 +1 @@
{
"product": {
"attributes": {
"name": {
"appearance": ""
}
}
}
}
{}

View File

@ -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);
}

View File

@ -38,10 +38,6 @@
"via": "users",
"plugin": "users-permissions",
"configurable": false
},
"products": {
"collection": "product",
"via": "user"
}
}
}
}