fix: 🐛 proxy promise deprecation (#1851)
* fix: 🐛 proxy promise deprecation
This commit is contained in:
1 parent
5cfd841c41
commit
af05799e12
2 files changed
+15
-9
No files matched your search
@@ -17,14 +17,20 @@ export default class ScopesScopeRolesRoleIndexRoute extends Route {
|
||||
*/
|
||||
async afterModel() {
|
||||
const currentScope = this.modelFor('scopes.scope');
|
||||
const subScopes = currentScope.isProject
|
||||
? []
|
||||
: (await this.store.query('scope', { scope_id: currentScope.id })).map(
|
||||
(scope) => ({
|
||||
model: scope,
|
||||
subScopes: this.store.query('scope', { scope_id: scope.id }),
|
||||
})
|
||||
);
|
||||
const scopes = await this.store.query('scope', {
|
||||
scope_id: currentScope.id,
|
||||
});
|
||||
let subScopes = [];
|
||||
//await the store query to fix ember's proxy promise deprecation warning
|
||||
if (!currentScope.isProject) {
|
||||
subScopes = await Promise.all(
|
||||
scopes.map(async (scope) => ({
|
||||
model: scope,
|
||||
subScopes: await this.store.query('scope', { scope_id: scope.id }),
|
||||
}))
|
||||
);
|
||||
}
|
||||
|
||||
const grantScopes = [
|
||||
{
|
||||
model: currentScope,
|
||||
|
||||
@@ -18913,7 +18913,7 @@ react-dom@^16:
|
||||
prop-types "^15.6.2"
|
||||
scheduler "^0.19.1"
|
||||
|
||||
react-is@^16.13.1:
|
||||
react-is@^16.13.1, react-is@^16.8.1:
|
||||
version "16.13.1"
|
||||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
|
||||
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
|
||||
|
||||
Reference in new issue
Block a user