mirror of
https://github.com/wassname/talk.git
synced 2026-07-25 13:30:59 +08:00
Simplify signOff rest
This commit is contained in:
@@ -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,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",
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user