mockup delete button for user

This commit is contained in:
Maren Süwer
2018-07-10 15:18:37 +02:00
parent 1e86353a82
commit 0648586092
6 changed files with 148 additions and 21 deletions

View File

@@ -1,16 +1,14 @@
// @flow
// get api base url from environment
const apiUrl = process.env.API_URL || process.env.PUBLIC_URL || "";
const apiUrl = process.env.API_URL || process.env.PUBLIC_URL || "/scm";
export const PAGE_NOT_FOUND_ERROR = Error("page not found");
// fetch does not send the X-Requested-With header (https://github.com/github/fetch/issues/17),
// but we need the header to detect ajax request (AjaxAwareAuthenticationRedirectStrategy).
const fetchOptions: RequestOptions = {
credentials: "same-origin",
headers: {
"X-Requested-With": "XMLHttpRequest"
Cache: "no-cache"
}
};
@@ -40,7 +38,7 @@ class ApiClient {
return this.httpRequestWithJSONBody(url, payload, "POST");
}
delete(url: string, payload: any) {
delete(url: string) {
let options: RequestOptions = {
method: "DELETE"
};