Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions app/routes/events/view/edit/sessions-speakers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import classic from 'ember-classic-decorator';
import Route from '@ember/routing/route';
import EventWizardMixin from 'open-event-frontend/mixins/event-wizard';
import { allSettled } from 'rsvp';
import RSVP, { allSettled } from 'rsvp';

@classic
export default class SessionsSpeakersRoute extends Route.extend(EventWizardMixin) {
Expand All @@ -14,7 +14,19 @@ export default class SessionsSpeakersRoute extends Route.extend(EventWizardMixin
const tracksPromise = data.event.get('tracks');
const microlocationsPromise = data.event.get('microlocations');
const sessionTypesPromise = data.event.get('sessionTypes');
const speakersCallPromise = this.getOrCreate(data.event, 'speakersCall', 'speakers-call');
const speakersCallPromise = new RSVP.Promise(resolve => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please move this to an async function, and use await in that function?

data.event
.get('speakersCall')
.then(relationshipRecord => {
resolve(relationshipRecord);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This then call is redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after removing then, the session page isn't loading

})
.catch(() => {
const record = this.store.createRecord('speakers-call', {
event: data.event
});
resolve(record);
});
});
// Only get session/speaker custom forms.
const customFormFilterOptions = [{
or: [
Expand Down
2 changes: 1 addition & 1 deletion app/routes/public/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class IndexRoute extends Route {
include : 'sessions.track',
'page[size]' : 0
});
const sponsorsPromise = event.query('sponsors', { 'page[size]' : 0 });
const sponsorsPromise = event.query('sponsors', { 'page[size]': 0 });
const taxPromise = event.get('tax');

const [tickets, featuredSpeakers, sponsors, tax] = (await allSettled([ticketsPromise, featuredSpeakersPromise, sponsorsPromise, taxPromise]))
Expand Down