fix: Attempted to call ZFormsInputSchema() from the server (#19540)
* fix: Attempted to call ZFormsInputSchema() from the server * chore: type optimisation --------- Co-authored-by: Alex van Andel <me@alexvanandel.com>
This commit is contained in:
co-authored by
Alex van Andel
parent
a4519e705d
commit
e4ab8d87c4
@@ -1,5 +1,3 @@
|
||||
"use client";
|
||||
|
||||
import { z } from "zod";
|
||||
|
||||
import { filterQuerySchemaStrict } from "@calcom/features/filters/lib/getTeamsFiltersFromQuery";
|
||||
|
||||
@@ -5,8 +5,8 @@ import {
|
||||
FilterCheckboxField,
|
||||
FilterCheckboxFieldsContainer,
|
||||
} from "@calcom/features/filters/components/TeamsFilter";
|
||||
import type { IEventTypeFilter } from "@calcom/features/filters/types/filter";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import type { RouterOutputs } from "@calcom/trpc/react";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { FilterSearchField } from "@calcom/ui";
|
||||
import { AnimatedPopover, Divider, Icon } from "@calcom/ui";
|
||||
@@ -14,9 +14,6 @@ import { AnimatedPopover, Divider, Icon } from "@calcom/ui";
|
||||
import { groupBy } from "../groupBy";
|
||||
import { useFilterQuery } from "../lib/useFilterQuery";
|
||||
|
||||
export type IEventTypesFilters = RouterOutputs["viewer"]["eventTypes"]["listWithTeam"];
|
||||
export type IEventTypeFilter = IEventTypesFilters[0];
|
||||
|
||||
type GroupedEventTypeState = Record<
|
||||
string,
|
||||
{
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
import type { RouterOutputs } from "@calcom/trpc/react";
|
||||
|
||||
export type IEventTypesFilters = RouterOutputs["viewer"]["eventTypes"]["listWithTeam"];
|
||||
export type IEventTypeFilter = IEventTypesFilters[0];
|
||||
|
||||
export function FilterResults({
|
||||
queryRes,
|
||||
SkeletonLoader,
|
||||
|
||||
@@ -6,7 +6,6 @@ import { classNames } from "@calcom/lib";
|
||||
import { getOrgOrTeamAvatar } from "@calcom/lib/defaultAvatarImage";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { useTypedQuery } from "@calcom/lib/hooks/useTypedQuery";
|
||||
import type { RouterOutputs } from "@calcom/trpc/react";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import {
|
||||
FilterSearchField,
|
||||
@@ -20,9 +19,6 @@ import {
|
||||
|
||||
import { filterQuerySchema } from "../lib/getTeamsFiltersFromQuery";
|
||||
|
||||
export type IEventTypesFilters = RouterOutputs["viewer"]["eventTypes"]["listWithTeam"];
|
||||
export type IEventTypeFilter = IEventTypesFilters[0];
|
||||
|
||||
function useFilterQuery() {
|
||||
// passthrough allows additional params to not be removed
|
||||
return useTypedQuery(filterQuerySchema.passthrough());
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
import type { ParsedUrlQuery } from "querystring";
|
||||
import { z } from "zod";
|
||||
|
||||
import type { RouterOutputs } from "@calcom/trpc/react";
|
||||
|
||||
export type IEventTypesFilters = RouterOutputs["viewer"]["eventTypes"]["listWithTeam"];
|
||||
export type IEventTypeFilter = IEventTypesFilters[0];
|
||||
|
||||
// Take array as a string and return zod array
|
||||
const queryStringArray = z
|
||||
.string()
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import type { EventType, Team } from "@calcom/prisma/client";
|
||||
|
||||
export type IEventTypeFilter = Pick<EventType, "id" | "slug" | "title"> & {
|
||||
team: Pick<Team, "id" | "name"> | null;
|
||||
};
|
||||
Reference in New Issue
Block a user