user preferences via API
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
class MyUserModleModel extends Model {
|
||||
|
||||
constructor(privileges) {
|
||||
super('', privileges)
|
||||
}
|
||||
|
||||
async getPreferences(){
|
||||
// let endpoint = this.getApiEndpoint('read')
|
||||
// endpoint.uri = endpoint.uri.replace('{mid}', mid)
|
||||
return (
|
||||
this.request('/api/preferences', 'get')
|
||||
.then( async serverData => serverData.payload)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
async setPreferences(prefs){
|
||||
// let endpoint = this.getApiEndpoint('read')
|
||||
// endpoint.uri = endpoint.uri.replace('{mid}', mid)
|
||||
return (
|
||||
this.request('/api/preferences', 'put', prefs)
|
||||
.then( async serverData => serverData.payload)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
app.registerClass('MyUserModleModel', MyUserModleModel)
|
||||
Reference in New Issue
Block a user