feat(app): add search and pagination (#1860)

This commit is contained in:
Meier Lukas
2025-01-04 23:06:34 +01:00
committed by GitHub
parent bf12944768
commit ccb19e06c1
7 changed files with 60 additions and 18 deletions

View File

@@ -1,3 +1,5 @@
import type { z } from "zod";
export type MaybePromise<T> = T | Promise<T>;
export type AtLeastOneOf<T> = [T, ...T[]];
@@ -16,3 +18,11 @@ export type Inverse<T extends Invertible> = {
};
type Invertible = Record<PropertyKey, PropertyKey>;
export type inferSearchParamsFromSchema<TSchema extends z.AnyZodObject> = inferSearchParamsFromSchemaInner<
z.infer<TSchema>
>;
type inferSearchParamsFromSchemaInner<TSchema extends Record<string, unknown>> = Partial<{
[K in keyof TSchema]: Exclude<TSchema[K], undefined> extends unknown[] ? string[] : string;
}>;