Add subscription ID search to admin team lookup (#284)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
KM Koushik
2025-10-26 09:40:11 +11:00
committed by GitHub
parent 4fe354b85a
commit 7edff5b783
2 changed files with 10 additions and 3 deletions
@@ -34,9 +34,9 @@ import { isCloud } from "~/utils/common";
const searchSchema = z.object({ const searchSchema = z.object({
query: z query: z
.string({ required_error: "Enter a team ID, name, domain, or member email" }) .string({ required_error: "Enter a team ID, name, domain, member email, or subscription ID" })
.trim() .trim()
.min(1, "Enter a team ID, name, domain, or member email"), .min(1, "Enter a team ID, name, domain, member email, or subscription ID"),
}); });
type SearchInput = z.infer<typeof searchSchema>; type SearchInput = z.infer<typeof searchSchema>;
@@ -150,7 +150,7 @@ export default function AdminTeamsPage() {
<FormLabel>Team lookup</FormLabel> <FormLabel>Team lookup</FormLabel>
<FormControl> <FormControl>
<Input <Input
placeholder="Team ID, team name, domain, or member email" placeholder="Team ID, team name, domain, member email, or subscription ID"
autoComplete="off" autoComplete="off"
{...field} {...field}
value={field.value} value={field.value}
+7
View File
@@ -373,6 +373,13 @@ export const adminRouter = createTRPCRouter({
}, },
}, },
}, },
{
subscription: {
some: {
id: { equals: query, mode: "insensitive" },
},
},
},
], ],
}, },
select: teamAdminSelection, select: teamAdminSelection,