mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-06 06:12:40 +02:00
12 lines
316 B
TypeScript
12 lines
316 B
TypeScript
|
|
import { defineQuery } from "@rocicorp/zero";
|
||
|
|
import { z } from "zod";
|
||
|
|
import { zql } from "../schema/index";
|
||
|
|
|
||
|
|
export const notificationQueries = {
|
||
|
|
byUser: defineQuery(
|
||
|
|
z.object({ userId: z.string() }),
|
||
|
|
({ args: { userId } }) =>
|
||
|
|
zql.notifications.where("userId", userId).orderBy("createdAt", "desc"),
|
||
|
|
),
|
||
|
|
};
|