Simplify signOff rest

This commit is contained in:
Chi Vinh Le
2018-08-23 08:55:16 +02:00
parent 0455293c0b
commit 5501ee7832
2 changed files with 5 additions and 5 deletions
+4 -1
View File
@@ -48,7 +48,10 @@ export class RestClient {
this.tokenGetter = tokenGetter;
}
public async fetch<T>(path: string, options: PartialRequestInit): Promise<T> {
public async fetch<T = {}>(
path: string,
options: PartialRequestInit
): Promise<T> {
let opts = options;
if (this.tokenGetter) {
opts = merge({}, options, {
+1 -4
View File
@@ -1,10 +1,7 @@
import { RestClient } from "../lib/rest";
// tslint:disable-next-line:no-empty-interface
export interface SignOffResponse {}
export default function signOff(rest: RestClient) {
return rest.fetch<SignOffResponse>("/tenant/auth/local", {
return rest.fetch("/tenant/auth/local", {
method: "DELETE",
});
}