feat: add workflow vars and search for event types (#17343)

* Udit:goat - thank you for this

* improve searchbar

* remove unused code

* add workflow vars

* change requested

* requested changes

* changes

* type-fix??

* type-fix??

* ----
This commit is contained in:
Syed Ali Shahbaz authored and GitHub committed 2024-10-25 22:38:48 +00:00
1 parent b9128a7a0b
commit 097c14ca64
12 files changed
+108 -17

No files matched your search

@@ -24,6 +24,7 @@ export const ZGetEventTypesFromGroupSchema = z.object({
cursor: z.number().nullish(),
limit: z.number().default(10),
group: z.object({ teamId: z.number().nullish(), parentId: z.number().nullish() }),
searchQuery: z.string().optional(),
});
export type TGetEventTypesFromGroupSchema = z.infer<typeof ZGetEventTypesFromGroupSchema>;
@@ -30,7 +30,7 @@ export const getEventTypesFromGroup = async ({ ctx, input }: GetByViewerOptions)
});
const userProfile = ctx.user.profile;
const { group, limit, cursor, filters } = input;
const { group, limit, cursor, filters, searchQuery } = input;
const { teamId, parentId } = group;
const isFilterSet = (filters && hasFilter(filters)) || !!teamId;
@@ -52,6 +52,7 @@ export const getEventTypesFromGroup = async ({ ctx, input }: GetByViewerOptions)
where: {
teamId: null,
schedulingType: null,
...(searchQuery ? { title: { contains: searchQuery, mode: "insensitive" } } : {}),
},
orderBy: [
{
@@ -83,6 +84,7 @@ export const getEventTypesFromGroup = async ({ ctx, input }: GetByViewerOptions)
schedulingType: { in: filters.schedulingTypes },
}
: null),
...(searchQuery ? { title: { contains: searchQuery, mode: "insensitive" } } : {}),
},
orderBy: [
{