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) {
|
async save(group) {
|
||||||
const { isNew } = group;
|
const { isNew } = group;
|
||||||
try {
|
try {
|
||||||
await group.save(this.scopeAdapterOptions());
|
await group.save();
|
||||||
this.refresh();
|
this.refresh();
|
||||||
this.notify.success(this.intl.t(
|
this.notify.success(this.intl.t(
|
||||||
isNew ? 'notify.create-success' : 'notify.save-success'
|
isNew ? 'notify.create-success' : 'notify.save-success'
|
||||||
@@ -68,8 +68,7 @@ export default class ScopesScopeGroupsRoute extends Route {
|
|||||||
}
|
}
|
||||||
|
|
||||||
scopeAdapterOptions() {
|
scopeAdapterOptions() {
|
||||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||||
const adapterOptions = { scopeID: scope_id };
|
return { adapterOptions: { scopeID } };
|
||||||
return { adapterOptions };
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,8 +10,7 @@ export default class ScopesScopeGroupsGroupRoute extends Route {
|
|||||||
* @return {groupModel}
|
* @return {groupModel}
|
||||||
*/
|
*/
|
||||||
async model({ group_id }) {
|
async model({ group_id }) {
|
||||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||||
const adapterOptions = { scopeID: scope_id };
|
return this.store.findRecord('group', group_id, { adapterOptions: { scopeID } });
|
||||||
return this.store.findRecord('group', group_id, { adapterOptions });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@ export default class ScopesScopeGroupsNewRoute extends Route {
|
|||||||
* @return {GroupModel}
|
* @return {GroupModel}
|
||||||
*/
|
*/
|
||||||
model() {
|
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) {
|
async save(role) {
|
||||||
const { isNew } = role;
|
const { isNew } = role;
|
||||||
try {
|
try {
|
||||||
await role.save(this.scopeAdapterOptions());
|
await role.save();
|
||||||
this.refresh();
|
this.refresh();
|
||||||
this.notify.success(this.intl.t(
|
this.notify.success(this.intl.t(
|
||||||
isNew ? 'notify.create-success' : 'notify.save-success'
|
isNew ? 'notify.create-success' : 'notify.save-success'
|
||||||
@@ -68,8 +68,7 @@ export default class ScopesScopeRolesRoute extends Route {
|
|||||||
}
|
}
|
||||||
|
|
||||||
scopeAdapterOptions() {
|
scopeAdapterOptions() {
|
||||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||||
const adapterOptions = { scopeID: scope_id };
|
return { adapterOptions: { scopeID } };
|
||||||
return { adapterOptions };
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@ export default class ScopesScopeRolesNewRoute extends Route {
|
|||||||
* @return {RoleModel}
|
* @return {RoleModel}
|
||||||
*/
|
*/
|
||||||
model() {
|
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}
|
* @return {RoleModel}
|
||||||
*/
|
*/
|
||||||
async model({ role_id }) {
|
async model({ role_id }) {
|
||||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||||
const adapterOptions = { scopeID: scope_id };
|
return this.store.findRecord('role', role_id, { adapterOptions: { scopeID } });
|
||||||
return this.store.findRecord('role', role_id, { adapterOptions });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ export default class ScopesScopeUsersRoute extends Route {
|
|||||||
async save(user) {
|
async save(user) {
|
||||||
const { isNew } = user;
|
const { isNew } = user;
|
||||||
try {
|
try {
|
||||||
await user.save(this.scopeAdapterOptions());
|
await user.save();
|
||||||
this.refresh();
|
this.refresh();
|
||||||
this.notify.success(this.intl.t(
|
this.notify.success(this.intl.t(
|
||||||
isNew ? 'notify.create-success' : 'notify.save-success'
|
isNew ? 'notify.create-success' : 'notify.save-success'
|
||||||
@@ -69,8 +69,7 @@ export default class ScopesScopeUsersRoute extends Route {
|
|||||||
}
|
}
|
||||||
|
|
||||||
scopeAdapterOptions() {
|
scopeAdapterOptions() {
|
||||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||||
const adapterOptions = { scopeID: scope_id };
|
return { adapterOptions: { scopeID } };
|
||||||
return { adapterOptions };
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@ export default class ScopesScopeUsersNewRoute extends Route {
|
|||||||
* @return {UserModel}
|
* @return {UserModel}
|
||||||
*/
|
*/
|
||||||
model() {
|
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}
|
* @return {UserModel}
|
||||||
*/
|
*/
|
||||||
async model({ user_id }) {
|
async model({ user_id }) {
|
||||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
const { id: scopeID } = this.modelFor('scopes.scope');
|
||||||
const adapterOptions = { scopeID: scope_id };
|
return this.store.findRecord('user', user_id, { adapterOptions: { scopeID } });
|
||||||
return this.store.findRecord('user', user_id, { adapterOptions });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user