unclean SPARC
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ICMPProjectModel extends EICModel {
|
||||
|
||||
current = null;
|
||||
|
||||
constructor(privileges) { super('/icmp', privileges); }
|
||||
|
||||
get(number) {
|
||||
if(!this.hasPrivilege('read')) return( new Promise((resolve, reject) => reject()))
|
||||
|
||||
this.current = null;
|
||||
|
||||
let endpoint = this.getApiEndpoint('getProject');
|
||||
endpoint.uri = endpoint.uri.replace('{projectId}', number);
|
||||
|
||||
return (
|
||||
this.request(endpoint.uri, endpoint.method)
|
||||
.then( async serverData => {
|
||||
this.current = this.sanitize(serverData.payload);
|
||||
return this.current;
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
sanitize(data) { return data; }
|
||||
|
||||
documents(number) {
|
||||
if(!this.hasPrivilege('read')) return( new Promise((resolve, reject) => reject()))
|
||||
|
||||
let endpoint = this.getApiEndpoint('getProjectDocuments');
|
||||
endpoint.uri = endpoint.uri.replace('{projectId}', number);
|
||||
|
||||
return (
|
||||
this.request(endpoint.uri, endpoint.method)
|
||||
.then( async serverData => {
|
||||
return serverData.payload;
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
contributors(number) {
|
||||
if(!this.hasPrivilege('read')) return( new Promise((resolve, reject) => reject()))
|
||||
|
||||
let endpoint = this.getApiEndpoint('getProjectContributors');
|
||||
endpoint.uri = endpoint.uri.replace('{projectId}', number);
|
||||
|
||||
return (
|
||||
this.request(endpoint.uri, endpoint.method)
|
||||
.then( async serverData => {
|
||||
return serverData.payload;
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
app.registerClass('ICMPProjectModel', ICMPProjectModel);
|
||||
Reference in New Issue
Block a user