feat(client/web): add settings ts client
This commit is contained in:
parent
3048ce2820
commit
8cce087c1f
1 changed files with 31 additions and 0 deletions
31
src/client/web/src/client/settings.ts
Normal file
31
src/client/web/src/client/settings.ts
Normal 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,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue