feat: add model of scope
This commit is contained in:
parent
465a005d05
commit
91a8f950ec
2 changed files with 12 additions and 1 deletions
|
@ -1,7 +1,9 @@
|
||||||
import Extend from 'flarum/common/extenders';
|
import Extend from 'flarum/common/extenders';
|
||||||
import Client from "./models/Client";
|
import Client from "./models/Client";
|
||||||
|
import Scope from "./models/Scope";
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
new Extend.Store()
|
new Extend.Store()
|
||||||
.add('oauth-clients', Client),
|
.add('oauth-clients', Client)
|
||||||
|
.add('oauth-scopes', Scope),
|
||||||
];
|
];
|
||||||
|
|
9
js/src/common/models/Scope.js
Normal file
9
js/src/common/models/Scope.js
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import Model from 'flarum/common/Model';
|
||||||
|
|
||||||
|
export default class Client extends Model {
|
||||||
|
scope = Model.attribute('scope');
|
||||||
|
is_default = Model.attribute('is_default', value => value === 1);
|
||||||
|
scope_name = Model.attribute('scope_name');
|
||||||
|
scope_icon = Model.attribute('scope_icon');
|
||||||
|
scope_desc = Model.attribute('scope_desc');
|
||||||
|
}
|
Loading…
Reference in a new issue