fix(#2652): add method for get country code from auth
parent
a4a32e99a6
commit
64237b3655
@ -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…
Reference in new issue