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)