2019-12-08 00:32:00 +05:30
|
|
|
import request, { Resp } from 'app/services/request';
|
2019-12-07 16:58:52 +05:30
|
|
|
|
|
|
|
type Options = { reCaptchaPublicKey: string };
|
|
|
|
|
|
|
|
let options: Resp<Options>;
|
|
|
|
|
|
|
|
export default {
|
2020-05-24 04:38:24 +05:30
|
|
|
async get(): Promise<Resp<Options>> {
|
|
|
|
if (options) {
|
|
|
|
return Promise.resolve(options);
|
|
|
|
}
|
2019-12-07 16:58:52 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
const resp = await request.get<Options>('/api/options', {}, { token: null });
|
2019-12-07 16:58:52 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
options = resp;
|
2019-12-07 16:58:52 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
return resp;
|
|
|
|
},
|
2019-12-07 16:58:52 +05:30
|
|
|
};
|