mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
b903126e5a
* feat: Instance Admin Panel: Configuration Settings * refactor: seprate Google and Github form into independent components. * feat: add admin auth wrapper and access denied page. * style: design updates.
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import { APIService } from "services/api.service";
|
|
// helpers
|
|
import { API_BASE_URL } from "helpers/common.helper";
|
|
// types
|
|
import type { IFormattedInstanceConfiguration, IInstance, IInstanceConfiguration } from "types/instance";
|
|
|
|
export class InstanceService extends APIService {
|
|
constructor() {
|
|
super(API_BASE_URL);
|
|
}
|
|
|
|
async getInstanceInfo(): Promise<IInstance> {
|
|
return this.get("/api/licenses/instances/")
|
|
.then((response) => response.data)
|
|
.catch((error) => {
|
|
throw error;
|
|
});
|
|
}
|
|
|
|
async updateInstanceInfo(
|
|
data: Partial<IInstance>
|
|
): Promise<IInstance> {
|
|
return this.patch("/api/licenses/instances/", data)
|
|
.then((response) => response?.data)
|
|
.catch((error) => {
|
|
throw error?.response?.data;
|
|
})
|
|
}
|
|
|
|
async getInstanceConfigurations() {
|
|
return this.get("/api/licenses/instances/configurations/")
|
|
.then((response) => response.data)
|
|
.catch((error) => {
|
|
throw error;
|
|
});
|
|
}
|
|
|
|
async updateInstanceConfigurations(
|
|
data: Partial<IFormattedInstanceConfiguration>
|
|
): Promise<IInstanceConfiguration[]> {
|
|
return this.patch("/api/licenses/instances/configurations/", data)
|
|
.then((response) => response?.data)
|
|
.catch((error) => {
|
|
throw error?.response?.data;
|
|
})
|
|
}
|
|
}
|