2023-10-04 15:13:05 +00:00
|
|
|
// services
|
2024-03-19 14:38:35 +00:00
|
|
|
import APIService from "@/services/api.service";
|
2023-10-04 15:13:05 +00:00
|
|
|
// helper
|
2024-03-19 14:38:35 +00:00
|
|
|
import { API_BASE_URL } from "@/helpers/common.helper";
|
2023-12-06 11:12:57 +00:00
|
|
|
// types
|
|
|
|
import { IAppConfig } from "types/app";
|
2023-10-04 15:13:05 +00:00
|
|
|
|
|
|
|
export class AppConfigService extends APIService {
|
|
|
|
constructor() {
|
|
|
|
super(API_BASE_URL);
|
|
|
|
}
|
|
|
|
|
2023-11-07 11:47:10 +00:00
|
|
|
async envConfig(): Promise<IAppConfig> {
|
2023-10-04 15:13:05 +00:00
|
|
|
return this.get("/api/configs/", {
|
|
|
|
headers: {
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
.then((response) => response?.data)
|
|
|
|
.catch((error) => {
|
|
|
|
throw error?.response?.data;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|