mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-10 01:52:04 +05:30
24 lines
408 B
TypeScript
24 lines
408 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;
|
|
},
|
|
};
|