accounts-frontend/src/services/api/options.ts

24 lines
404 B
TypeScript
Raw Normal View History

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