We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
getGeoCoordinates
1 parent 6f8f9b3 commit cdb12e7Copy full SHA for cdb12e7
packages/api/src/platforms/vtex/resolvers/validateSession.ts
@@ -30,28 +30,6 @@ async function getPreciseLocationData(
30
}
31
32
33
-async function getGeoCoordinates(
34
- clients: Context['clients'],
35
- country: string,
36
- postalCode: string
37
-) {
38
- try {
39
- const address = await clients.commerce.checkout.address({
40
- postalCode,
41
- country,
42
- })
43
-
44
- const [longitude, latitude] = address.geoCoordinates
45
- return { latitude, longitude }
46
- } catch (err) {
47
- console.error(
48
- `Error while getting geo coordinates for the current postal code (${postalCode}) and country (${country}).\n`
49
- )
50
51
- throw err
52
- }
53
-}
54
55
export const validateSession = async (
56
_: any,
57
{ session: oldSession, search }: MutationValidateSessionArgs,
0 commit comments