unclean SPARC
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
class ApplicantOrganisationsModel extends EICPluralModel {
|
||||
|
||||
constructor(privileges) {
|
||||
super('/organisations', privileges);
|
||||
this.singletonClass = class {
|
||||
itemData = {
|
||||
pic: null,
|
||||
legalname: null,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
search(criteria) { // search onlegalname can bring several
|
||||
if(!this.hasPrivilege('search')) return( new Promise((resolve, reject) => reject()))
|
||||
|
||||
let endpoint = this.getApiEndpoint('search');
|
||||
let uri = endpoint.uri
|
||||
|
||||
return (
|
||||
this.request(uri, endpoint.method, {'search': criteria })
|
||||
.then( async serverData => this.loadData(serverData.payload))
|
||||
)
|
||||
}
|
||||
|
||||
list() {
|
||||
if(!this.hasPrivilege('list')) return( new Promise((resolve, reject) => reject()))
|
||||
|
||||
let endpoint = this.getApiEndpoint('list');
|
||||
let uri = endpoint.uri
|
||||
return (
|
||||
this.request(uri, endpoint.method)
|
||||
.then( async serverData => {
|
||||
const payload = serverData.payload;
|
||||
//this.fill(payload);
|
||||
|
||||
return payload;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
app.registerClass('ApplicantOrganisationsModel', ApplicantOrganisationsModel);
|
||||
Reference in New Issue
Block a user