mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-04 05:12:38 +02:00
11 lines
331 B
TypeScript
11 lines
331 B
TypeScript
import { defineQuery } from "@rocicorp/zero";
|
|
import { z } from "zod";
|
|
import { zql } from "../schema/index";
|
|
|
|
export const userQueries = {
|
|
me: defineQuery(z.object({}), ({ ctx }) => {
|
|
const userId = ctx?.userId;
|
|
if (!userId) return zql.user.where("id", "__none__").one();
|
|
return zql.user.where("id", userId).one();
|
|
}),
|
|
};
|