Last active
November 1, 2021 13:08
-
-
Save YonathanMeguira/6cca0eafabfd246acc9e1efdf2d58154 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Response { | |
requestId: string; | |
// status could be for instance: Request Approved, or Request Failed to approve because it does not exist anymore. | |
// status is either a success message or an error message that explains why the operation (deny/ approve / revoke) failed. | |
status: string; | |
email: string; | |
} | |
/** | |
All operations, deny, approve and revoke, take as an input an array of request ids. | |
its returns as a response, an array of Response (one Response per request) | |
**/ | |
bulkApprove(ids: number[]) { | |
const url = this.uriUtil.translate(URI_CONSTANTS.account.bulkApprove); | |
// bulkApprove: `${API_URLS.services}admin/permissions/request-access/bulk-approve`, | |
return this.http.post<Response[]>(url, ids); | |
} | |
bulkDeny(ids: number[]) { | |
const url = this.uriUtil.translate(URI_CONSTANTS.account.bulkDeny) | |
// bulkDeny: `${API_URLS.services}admin/permissions/request-access/bulk-deny`, | |
return this.http.post<Response[]>(url, ids); | |
} | |
bulkRevoke(ids: number[]) { | |
const url = this.uriUtil.translate(URI_CONSTANTS.account.bulkRevoke); | |
// bulkRevoke: `${API_URLS.services}admin/permissions/request-access/bulk-revoke`, | |
return this.http.post<Response[]>(url, ids); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment