{"size": 519, "ext": "js", "max_stars_repo_path": "server/api/actions/notifications/loadAll.js", "max_stars_repo_name": "georgegillams/screen-reader-adventures", "max_stars_repo_stars_event_min_datetime": "2019-05-17T15:51:05.000Z", "max_stars_repo_stars_event_max_datetime": "2019-09-18T09:07:18.000Z", "max_issues_repo_path": "server/api/actions/notifications/loadAll.js", "max_issues_repo_name": "georgegillams/screen-reader-adventures", "max_issues_repo_issues_event_min_datetime": "2019-09-02T18:06:57.000Z", "max_issues_repo_issues_event_max_datetime": "2020-05-29T10:49:22.000Z", "max_forks_repo_path": "server/api/actions/notifications/loadAll.js", "max_forks_repo_name": "georgegillams/screen-reader-adventures", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 82, "max_forks_count": null, "avg_line_length": 28.8333333333, "max_line_length": 86, "alphanum_fraction": 0.7129094412}
import notificationsAllowedAttributes from './private/notificationsAllowedAttributes';

import { dbLoad } from 'utils/database';
import authentication from 'utils/authentication';
import reqSecure from 'utils/reqSecure';

export default function loadAll(req) {
  reqSecure(req, notificationsAllowedAttributes);
  return authentication(req)
    .then(user =>
      dbLoad({
        redisKey: 'notifications',
        includeDeleted: user && user.admin,
      }),
    )
    .then(notifications => ({ notifications }));
}
