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