accounts-frontend/packages/app/services/api/options.ts
2020-05-24 02:08:24 +03:00

20 lines
413 B
TypeScript

import request, { Resp } from 'app/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;
},
};