chore: instance admins endpoint added and ui/ux improvement (#2895)

* style: sidebar improvement

* style: header height consistency

* chore: layout consistency and general page improvement

* chore: layout, email form and image form improvement

* chore: instance admins endpoint intergrated and code refactor

* chore: code refactor

* chore: google client secret section removed
This commit is contained in:
Anmol Singh Bhatia 2023-11-27 17:15:11 +05:30 committed by sriram veeraghanta
parent f79bd9df60
commit 6e940399cb
16 changed files with 140 additions and 109 deletions

View file

@ -2,7 +2,12 @@ import { APIService } from "services/api.service";
// helpers
import { API_BASE_URL } from "helpers/common.helper";
// types
import type { IFormattedInstanceConfiguration, IInstance, IInstanceConfiguration } from "types/instance";
import type {
IFormattedInstanceConfiguration,
IInstance,
IInstanceAdmin,
IInstanceConfiguration,
} from "types/instance";
export class InstanceService extends APIService {
constructor() {
@ -17,14 +22,20 @@ export class InstanceService extends APIService {
});
}
async updateInstanceInfo(
data: Partial<IInstance>
): Promise<IInstance> {
async getInstanceAdmins(): Promise<IInstanceAdmin[]> {
return this.get("/api/licenses/instances/admins/")
.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;
})
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
async getInstanceConfigurations() {
@ -39,9 +50,9 @@ export class InstanceService extends APIService {
data: Partial<IFormattedInstanceConfiguration>
): Promise<IInstanceConfiguration[]> {
return this.patch("/api/licenses/instances/configurations/", data)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
})
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
}