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:
3 files changed
+16
-31
No files matched your search
@@ -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({
|
||||
|
||||
Reference in new issue
Block a user