2023-10-04 13:25:29 +00:00
|
|
|
// services
|
2023-12-04 06:41:36 +00:00
|
|
|
import { APIService } from "services/api.service";
|
2023-10-04 13:25:29 +00:00
|
|
|
// helper
|
|
|
|
import { API_BASE_URL } from "helpers/common.helper";
|
2023-12-04 06:41:36 +00:00
|
|
|
// types
|
|
|
|
import { IAppConfig } from "types/app";
|
2023-10-04 13:25:29 +00:00
|
|
|
|
|
|
|
export class AppConfigService extends APIService {
|
|
|
|
constructor() {
|
|
|
|
super(API_BASE_URL);
|
|
|
|
}
|
|
|
|
|
2023-12-04 06:41:36 +00:00
|
|
|
async envConfig(): Promise<IAppConfig> {
|
2023-10-04 13:25:29 +00:00
|
|
|
return this.get("/api/configs/", {
|
|
|
|
headers: {
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
},
|
|
|
|
})
|
2023-12-04 06:41:36 +00:00
|
|
|
.then((response) => response.data)
|
2023-10-04 13:25:29 +00:00
|
|
|
.catch((error) => {
|
|
|
|
throw error?.response?.data;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|