mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
accompanying course: fetch users and suggested referrers only for app, not for banner
This commit is contained in:
parent
1967fc4bed
commit
fefe208260
@ -13,7 +13,7 @@ const root = window.vueRootComponent;
|
||||
* Load all App component, for AccompanyingCourse edition page
|
||||
*/
|
||||
if (root === 'app') {
|
||||
initPromise.then(store => {
|
||||
initPromise(root).then(store => {
|
||||
|
||||
const i18n = _createI18n(appMessages);
|
||||
|
||||
@ -37,7 +37,7 @@ if (root === 'app') {
|
||||
* Load only Banner sub-component, for all others AccompanyingCourse page
|
||||
*/
|
||||
if (root === 'banner') {
|
||||
initPromise.then(store => {
|
||||
initPromise(root).then(store => {
|
||||
|
||||
const i18n = _createI18n(appMessages);
|
||||
|
||||
|
@ -16,7 +16,7 @@ const id = window.accompanyingCourseId;
|
||||
let scopesPromise = fetchScopes();
|
||||
let accompanyingCoursePromise = getAccompanyingCourse(id);
|
||||
|
||||
let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
|
||||
let initPromise = (root) => Promise.all([scopesPromise, accompanyingCoursePromise])
|
||||
.then(([scopes, accompanyingCourse]) => new Promise((resolve, reject) => {
|
||||
|
||||
const store = createStore({
|
||||
@ -796,8 +796,11 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
|
||||
}
|
||||
});
|
||||
|
||||
store.dispatch('fetchReferrersSuggested');
|
||||
store.dispatch('fetchUsers');
|
||||
if (root === 'app') {
|
||||
store.dispatch('fetchReferrersSuggested');
|
||||
store.dispatch('fetchUsers');
|
||||
}
|
||||
|
||||
resolve(store);
|
||||
}));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user