import { GenericService } from '../GenericService'
class TenantSettingsService extends GenericService {
    constructor() {
        super('/api/tenant/settings')
    }

    getGeneralSettings = () => this.get(this.endPoint + '/general')
    setGeneralSettings = (settings) =>
        this.post(this.endPoint + '/general', settings)
    setSettingByKey = (key, data) =>
        this.post(this.endPoint + '/insert/' + key, { data })
    getSettingByKey = (key) => this.get(this.endPoint + '/' + key)

    // setSettings = (settings) => this.post(this.apiPrefix, settings);
    // setSettingByKey = (key, value) =>
    //   this.post(this.endPoint + "/" + key, { value });
    // getSettingByKey = (key) => this.get(this.endPoint + "/" + key);
    // getGoogleAPIKey = (key) =>
    //   new Promise((resolve, reject) => {
    //     resolve("AIzaSyCzZ7ZOAB2J6QaH2N1G0nAYds4fDfFjF5Y");
    //   });
    //getGoogleAPIKey = (key) => this.getSettingByKey("googleAPIKey");
}
const tenantSettingsService = new TenantSettingsService()
export default tenantSettingsService
