2023-10-04 15:13:05 +00:00
|
|
|
// services
|
|
|
|
import APIService from "services/api.service";
|
|
|
|
// helper
|
|
|
|
import { API_BASE_URL } from "helpers/common.helper";
|
|
|
|
|
2023-11-07 11:47:10 +00:00
|
|
|
export interface IAppConfig {
|
2023-10-04 15:13:05 +00:00
|
|
|
email_password_login: boolean;
|
2023-11-07 11:47:10 +00:00
|
|
|
google_client_id: string | null;
|
|
|
|
github_app_name: string | null;
|
|
|
|
github_client_id: string | null;
|
2023-10-04 15:13:05 +00:00
|
|
|
magic_login: boolean;
|
2023-11-07 11:47:10 +00:00
|
|
|
slack_client_id: string | null;
|
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;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|