Reports: import statuses, add getReport selector

This commit is contained in:
Alex Gleason
2020-12-31 20:11:08 -06:00
parent 90414939a5
commit a8893907d4
4 changed files with 22 additions and 1 deletions

View File

@ -175,3 +175,18 @@ export const makeGetChat = () => {
},
);
};
export const makeGetReport = () => {
return createSelector(
[
(state, id) => state.getIn(['admin', 'reports', id]),
(state, id) => state.getIn(['admin', 'reports', id, 'statuses']).map(
statusId => state.getIn(['statuses', statusId])),
],
(report, statuses) => {
if (!report) return null;
return report.set('statuses', statuses);
},
);
};