feat(client/web): add settings ts client

This commit is contained in:
hexxa 2021-10-09 17:01:54 +08:00 committed by Hexxa
parent 3048ce2820
commit 8cce087c1f

View file

@ -0,0 +1,31 @@
import { BaseClient, Response, userIDParam, Quota } from ".";
import { ClientConfig } from "./";
export class SettingsClient extends BaseClient {
constructor(url: string) {
super(url);
}
health = (): Promise<Response> => {
return this.do({
method: "get",
url: `${this.url}/v1/settings/health`,
});
};
getClientCfg = (): Promise<Response> => {
return this.do({
method: "get",
url: `${this.url}/v1/settings/client`,
});
};
setClientCfg = (cfg: ClientConfig): Promise<Response> => {
return this.do({
method: "patch",
url: `${this.url}/v1/settings/client`,
data: cfg,
});
};
}