Skip to content

Commit

Permalink
Merge pull request #177 from futa-ikeda/feature/load-all-contribs
Browse files Browse the repository at this point in the history
[ENG-2227] Load all authors for moderator preprint detail page
  • Loading branch information
adlius committed Apr 9, 2021
2 parents 442605d + 7222a62 commit 588b9d3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/controllers/preprints/provider/preprint-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { inject as service } from '@ember/service';
import Controller from '@ember/controller';

import { task, waitForQueue } from 'ember-concurrency';
import loadAll from 'ember-osf/utils/load-relationship';
import $ from 'jquery';


Expand Down Expand Up @@ -168,14 +169,18 @@ export default Controller.extend({
const response = yield this.get('store').findRecord(
'preprint',
preprintId,
{ include: ['node', 'license', 'review_actions', 'contributors'] },
{ include: ['node', 'license', 'review_actions'] },
).catch(() => this.replaceRoute('page-not-found'));

const contributors = [];
loadAll(response, 'contributors', contributors, {
filter: { bibliographic: true },
});
this.set('authors', contributors);
this.set('preprint', response);
if (response.get('dateWithdrawn') !== null) {
this.set('isWithdrawn', true);
}
this.set('authors', response.get('contributors'));
this.set('preprint', response);
let withdrawalRequest = yield this.get('preprint.requests');
withdrawalRequest = withdrawalRequest.toArray();
Expand Down

0 comments on commit 588b9d3

Please sign in to comment.