fix: create a trpc route for fetching country (#7555)

* fix: create a trpc route for fetching country

Signed-off-by: Udit Takkar <[email protected]>

* fix: type error

Signed-off-by: Udit Takkar <[email protected]>

---------

Signed-off-by: Udit Takkar <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-03-08 12:33:42 +00:00
1 parent 84da528d4d
commit 4e1e2577eb
3 files changed
+16 -31

No files matched your search

+6
View File
@@ -68,6 +68,12 @@ const publicViewerRouter = router({
locale,
};
}),
countryCode: publicProcedure.query(({ ctx }) => {
const { req } = ctx;
const countryCode: string | string[] = req?.headers?.["x-vercel-ip-country"] ?? "";
return { countryCode: Array.isArray(countryCode) ? countryCode[0] : countryCode };
}),
samlTenantProduct: publicProcedure
.input(
z.object({