fix(#2652): add method for get country code from auth

keep-around/31934c87741a585cc6b3c9552489ffa62de670b6
Andrei Dekterev 3 years ago
parent a4a32e99a6
commit 64237b3655
  1. 19
      src/requests/getCountryCode.tsx

@ -0,0 +1,19 @@
import { AUTH_SERVICE } from 'config'
import { callApi, readToken } from 'helpers'
export type CountryCodeType = {
country_code?: string,
error?: string,
ok: boolean,
}
export const getCountryCode = async (): Promise<CountryCodeType> => {
const config = {
method: 'GET',
}
return callApi({
config,
url: `${AUTH_SERVICE}/country?refresh_token=${readToken()}`,
})
}
Loading…
Cancel
Save