mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-16 21:05:20 +02:00
12 lines
461 B
TypeScript
12 lines
461 B
TypeScript
import { defineQuery } from "@rocicorp/zero";
|
|
import { z } from "zod";
|
|
import { zql } from "../schema/index";
|
|
|
|
export const podcastQueries = {
|
|
bySpace: defineQuery(z.object({ searchSpaceId: z.number() }), ({ args: { searchSpaceId } }) =>
|
|
zql.podcasts.where("searchSpaceId", searchSpaceId).orderBy("createdAt", "desc")
|
|
),
|
|
byId: defineQuery(z.object({ podcastId: z.number() }), ({ args: { podcastId } }) =>
|
|
zql.podcasts.where("id", podcastId).one()
|
|
),
|
|
};
|