chore: 🤖 Update IAM scope adapteroptions for find, save, & del
This commit is contained in:
9 files changed
+21
-24
No files matched your search
@@ -38,7 +38,7 @@ export default class ScopesScopeGroupsRoute extends Route {
|
||||
async save(group) {
|
||||
const { isNew } = group;
|
||||
try {
|
||||
await group.save(this.scopeAdapterOptions());
|
||||
await group.save();
|
||||
this.refresh();
|
||||
this.notify.success(this.intl.t(
|
||||
isNew ? 'notify.create-success' : 'notify.save-success'
|
||||
@@ -68,8 +68,7 @@ export default class ScopesScopeGroupsRoute extends Route {
|
||||
}
|
||||
|
||||
scopeAdapterOptions() {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
||||
const adapterOptions = { scopeID: scope_id };
|
||||
return { adapterOptions };
|
||||
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||
return { adapterOptions: { scopeID } };
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,7 @@ export default class ScopesScopeGroupsGroupRoute extends Route {
|
||||
* @return {groupModel}
|
||||
*/
|
||||
async model({ group_id }) {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
||||
const adapterOptions = { scopeID: scope_id };
|
||||
return this.store.findRecord('group', group_id, { adapterOptions });
|
||||
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||
return this.store.findRecord('group', group_id, { adapterOptions: { scopeID } });
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ export default class ScopesScopeGroupsNewRoute extends Route {
|
||||
* @return {GroupModel}
|
||||
*/
|
||||
model() {
|
||||
return this.store.createRecord('group');
|
||||
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||
return this.store.createRecord('group', { scopeID });
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ export default class ScopesScopeRolesRoute extends Route {
|
||||
async save(role) {
|
||||
const { isNew } = role;
|
||||
try {
|
||||
await role.save(this.scopeAdapterOptions());
|
||||
await role.save();
|
||||
this.refresh();
|
||||
this.notify.success(this.intl.t(
|
||||
isNew ? 'notify.create-success' : 'notify.save-success'
|
||||
@@ -68,8 +68,7 @@ export default class ScopesScopeRolesRoute extends Route {
|
||||
}
|
||||
|
||||
scopeAdapterOptions() {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
||||
const adapterOptions = { scopeID: scope_id };
|
||||
return { adapterOptions };
|
||||
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||
return { adapterOptions: { scopeID } };
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ export default class ScopesScopeRolesNewRoute extends Route {
|
||||
* @return {RoleModel}
|
||||
*/
|
||||
model() {
|
||||
return this.store.createRecord('role');
|
||||
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||
return this.store.createRecord('role', { scopeID });
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,7 @@ export default class ScopesScopeRolesRoleRoute extends Route {
|
||||
* @return {RoleModel}
|
||||
*/
|
||||
async model({ role_id }) {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
||||
const adapterOptions = { scopeID: scope_id };
|
||||
return this.store.findRecord('role', role_id, { adapterOptions });
|
||||
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||
return this.store.findRecord('role', role_id, { adapterOptions: { scopeID } });
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ export default class ScopesScopeUsersRoute extends Route {
|
||||
async save(user) {
|
||||
const { isNew } = user;
|
||||
try {
|
||||
await user.save(this.scopeAdapterOptions());
|
||||
await user.save();
|
||||
this.refresh();
|
||||
this.notify.success(this.intl.t(
|
||||
isNew ? 'notify.create-success' : 'notify.save-success'
|
||||
@@ -69,8 +69,7 @@ export default class ScopesScopeUsersRoute extends Route {
|
||||
}
|
||||
|
||||
scopeAdapterOptions() {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
||||
const adapterOptions = { scopeID: scope_id };
|
||||
return { adapterOptions };
|
||||
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||
return { adapterOptions: { scopeID } };
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ export default class ScopesScopeUsersNewRoute extends Route {
|
||||
* @return {UserModel}
|
||||
*/
|
||||
model() {
|
||||
return this.store.createRecord('user');
|
||||
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||
return this.store.createRecord('user', { scopeID });
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,7 @@ export default class ScopesScopeUsersUserRoute extends Route {
|
||||
* @return {UserModel}
|
||||
*/
|
||||
async model({ user_id }) {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
||||
const adapterOptions = { scopeID: scope_id };
|
||||
return this.store.findRecord('user', user_id, { adapterOptions });
|
||||
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||
return this.store.findRecord('user', user_id, { adapterOptions: { scopeID } });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user