mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-22 03:01:07 +00:00
26 lines
590 B
TypeScript
26 lines
590 B
TypeScript
import {
|
|
createSearchParamsCache,
|
|
parseAsInteger,
|
|
parseAsString,
|
|
parseAsBoolean,
|
|
parseAsArrayOf,
|
|
parseAsJson,
|
|
} from "nuqs/server";
|
|
import { z } from "zod";
|
|
|
|
export const homeSearchParamsCache = createSearchParamsCache({
|
|
firstTime: parseAsBoolean.withDefault(false),
|
|
});
|
|
|
|
export const chatSearchParamsCache = createSearchParamsCache({
|
|
firstTime: parseAsBoolean.withDefault(false),
|
|
q: parseAsString.withDefault(""),
|
|
spaces: parseAsArrayOf(
|
|
parseAsJson(() =>
|
|
z.object({
|
|
id: z.string(),
|
|
name: z.string(),
|
|
}),
|
|
),
|
|
).withDefault([]),
|
|
});
|