konsta
08/07/2022, 12:33 PMArgument of type '{ where: { priority: { in: ("low" | "medium" | "high" | "urgent")[] | null | undefined; }; status: { in: ("open" | "in progress" | "done" | "in review" | "canceled")[] | null | undefined; }; }; by: ("projectId" | ... 1 more ... | "priority")[]; _count: true; orderBy: { ...; }; }' is not assignable to parameter of type '{ where: { priority: { in: ("low" | "medium" | "high" | "urgent")[] | null | undefined; }; status: { in: ("open" | "in progress" | "done" | "in review" | "canceled")[] | null | undefined; }; }; by: ("projectId" | ... 1 more ... | "priority")[]; _count: true; orderBy: { ...; }; } & { ...; } & (`Error: Field "${string...'.
Type '{ where: { priority: { in: ("low" | "medium" | "high" | "urgent")[] | null | undefined; }; status: { in: ("open" | "in progress" | "done" | "in review" | "canceled")[] | null | undefined; }; }; by: ("projectId" | ... 1 more ... | "priority")[]; _count: true; orderBy: { ...; }; }' is not assignable to type '{ where: { priority: { in: ("low" | "medium" | "high" | "urgent")[] | null | undefined; }; status: { in: ("open" | "in progress" | "done" | "in review" | "canceled")[] | null | undefined; }; }; by: ("projectId" | ... 1 more ... | "priority")[]; _count: true; orderBy: { ...; }; } & { ...; } & `Error: Field "${number}...'.
Type '{ where: { priority: { in: ("low" | "medium" | "high" | "urgent")[] | null | undefined; }; status: { in: ("open" | "in progress" | "done" | "in review" | "canceled")[] | null | undefined; }; }; by: ("projectId" | ... 1 more ... | "priority")[]; _count: true; orderBy: { ...; }; }' is not assignable to type '`Error: Field "${number}" in "orderBy" needs to be provided in "by"`'.ts(2345)
Austin
08/08/2022, 9:42 PMGetGroupedIssuesRequest
and GetFilteredIssuesRequest
types?konsta
08/09/2022, 6:30 AMexport const PRIORITIES = ['low', 'medium', 'high', 'urgent'] as const
export const STATUSES = [
'open',
'in progress',
'done',
'in review',
'canceled',
] as const
export const ALLOWED_GROUP_BY_FIELDS = [
'status',
'priority',
'projectId',
] as const
const filteredIssuesRequestSchema = z.object({
parentIssueId: z.number().optional().nullable(),
projectId: z.number().optional().nullable(),
priority: z.array(z.enum(PRIORITIES)).optional().nullable(),
status: z.array(z.enum(STATUSES)).optional().nullable(),
})
const groupedIssuesRequestSchema = z.object({
field: z.enum(ALLOWED_GROUP_BY_FIELDS),
})
export type GetFilteredIssuesRequest = z.infer<typeof filteredIssuesRequestSchema>
export type GetGroupedIssuesRequest = z.infer<typeof groupedIssuesRequestSchema>
konsta
08/09/2022, 6:32 AMtype GetFilteredIssuesRequest = {
status?: ("open" | "in progress" | "done" | "in review" | "canceled")[] | null | undefined;
priority?: ("low" | "medium" | "high" | "urgent")[] | null | undefined;
projectId?: number | null | undefined;
parentIssueId?: number | ... 1 more ... | undefined;
}
type GetGroupedIssuesRequest = {
field: "status" | "priority" | "projectId";
}
Austin
08/09/2022, 3:24 PMkonsta
08/11/2022, 5:52 AMAustin
08/11/2022, 2:56 PM