refactor: rename parent_scope_id to scope_id
This commit is contained in:
2 files changed
+3
-3
No files matched your search
@@ -13,7 +13,7 @@ export default class ScopeSerializer extends ApplicationSerializer {
|
||||
/**
|
||||
* While most resources do not serialize scope into a request body (scope
|
||||
* is expressed in the URL), scopes themselves _do serialize scope_ as a
|
||||
* string field `parent_scope_id`.
|
||||
* string field `scope_id`.
|
||||
* Otherwise delegate to default attribute serializer.
|
||||
*
|
||||
* @override
|
||||
@@ -27,7 +27,7 @@ export default class ScopeSerializer extends ApplicationSerializer {
|
||||
const value = super.serializeAttribute(...arguments);
|
||||
const parentScope = snapshot.attr('scope');
|
||||
if (key === 'scope' && this._canSerialize(key) && parentScope) {
|
||||
json.parent_scope_id = parentScope.attr('scope_id');
|
||||
json.scope_id = parentScope.attr('scope_id');
|
||||
delete json[key];
|
||||
}
|
||||
return value;
|
||||
|
||||
@@ -26,7 +26,7 @@ module('Unit | Serializer | scope', function(hooks) {
|
||||
type: 'org',
|
||||
name: 'User',
|
||||
description: 'Description',
|
||||
parent_scope_id: 'global'
|
||||
scope_id: 'global'
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user