File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import { useQuery } from "@tanstack/react-query" ;
44import { orpc } from "@/lib/orpc" ;
55
6- export interface MonitorLight {
7- id : string ;
8- name : string | null ;
9- url : string | null ;
10- websiteId : string | null ;
11- website : {
12- id : string ;
13- name : string | null ;
14- domain : string ;
15- } | null ;
16- }
17-
186export function useMonitorsLight ( options ?: { enabled ?: boolean } ) {
197 const query = useQuery ( {
208 ...orpc . uptime . listSchedules . queryOptions ( { input : { } } ) ,
@@ -23,7 +11,11 @@ export function useMonitorsLight(options?: { enabled?: boolean }) {
2311 } ) ;
2412
2513 return {
26- monitors : ( query . data ?? [ ] ) as MonitorLight [ ] ,
14+ monitors : query . data ?? [ ] ,
2715 isLoading : query . isLoading ,
2816 } ;
2917}
18+
19+ export type MonitorLight = ReturnType <
20+ typeof useMonitorsLight
21+ > [ "monitors" ] [ number ] ;
Original file line number Diff line number Diff line change @@ -115,6 +115,10 @@ const getScheduleOutputSchema = z
115115
116116const scheduleOutputSchema = z . record ( z . string ( ) , z . unknown ( ) ) ;
117117
118+ const listScheduleItemSchema = getScheduleOutputSchema
119+ . omit ( { qstashStatus : true } )
120+ . loose ( ) ;
121+
118122export const uptimeRouter = {
119123 getScheduleByWebsiteId : protectedProcedure
120124 . route ( {
@@ -159,7 +163,7 @@ export const uptimeRouter = {
159163 } )
160164 . default ( { } )
161165 )
162- . output ( z . array ( scheduleOutputSchema ) )
166+ . output ( z . array ( listScheduleItemSchema ) )
163167 . handler ( async ( { context, input } ) => {
164168 const orgId = input . organizationId ?? context . organizationId ;
165169
You can’t perform that action at this time.
0 commit comments