@@ -2,6 +2,7 @@ import type { WebSocketMessageValue } from '$features/websockets/models';
2
2
import type { CountResult } from '$shared/models' ;
3
3
4
4
import { accessToken } from '$features/auth/index.svelte' ;
5
+ import { DEFAULT_OFFSET } from '$features/shared/api/api.svelte' ;
5
6
import { type ProblemDetails , useFetchClient } from '@exceptionless/fetchclient' ;
6
7
import { createQuery , QueryClient , useQueryClient } from '@tanstack/svelte-query' ;
7
8
@@ -48,6 +49,10 @@ export interface GetCountRequest {
48
49
}
49
50
50
51
export interface GetEventRequest {
52
+ params ?: {
53
+ offset ?: string ;
54
+ time ?: string ;
55
+ } ;
51
56
route : {
52
57
id : string | undefined ;
53
58
} ;
@@ -117,7 +122,10 @@ export function getCountQuery(request: GetCountRequest) {
117
122
queryFn : async ( { signal } : { signal : AbortSignal } ) => {
118
123
const client = useFetchClient ( ) ;
119
124
const response = await client . getJSON < CountResult > ( 'events/count' , {
120
- params : request . params ,
125
+ params : {
126
+ ...( DEFAULT_OFFSET ? { offset : DEFAULT_OFFSET } : { } ) ,
127
+ ...request . params
128
+ } ,
121
129
signal
122
130
} ) ;
123
131
@@ -133,6 +141,10 @@ export function getEventQuery(request: GetEventRequest) {
133
141
queryFn : async ( { signal } : { signal : AbortSignal } ) => {
134
142
const client = useFetchClient ( ) ;
135
143
const response = await client . getJSON < PersistentEvent > ( `events/${ request . route . id } ` , {
144
+ params : {
145
+ ...( DEFAULT_OFFSET ? { offset : DEFAULT_OFFSET } : { } ) ,
146
+ ...request . params
147
+ } ,
136
148
signal
137
149
} ) ;
138
150
@@ -151,7 +163,10 @@ export function getProjectCountQuery(request: GetProjectCountRequest) {
151
163
queryFn : async ( { signal } : { signal : AbortSignal } ) => {
152
164
const client = useFetchClient ( ) ;
153
165
const response = await client . getJSON < CountResult > ( `/projects/${ request . route . projectId } /events/count` , {
154
- params : request . params ,
166
+ params : {
167
+ ...( DEFAULT_OFFSET ? { offset : DEFAULT_OFFSET } : { } ) ,
168
+ ...request . params
169
+ } ,
155
170
signal
156
171
} ) ;
157
172
@@ -171,6 +186,7 @@ export function getStackCountQuery(request: GetStackCountRequest) {
171
186
const client = useFetchClient ( ) ;
172
187
const response = await client . getJSON < CountResult > ( 'events/count' , {
173
188
params : {
189
+ ...( DEFAULT_OFFSET ? { offset : DEFAULT_OFFSET } : { } ) ,
174
190
...request . params ,
175
191
filter : request . params ?. filter ?. includes ( `stack:${ request . route . stackId } ` )
176
192
? request . params . filter
@@ -199,7 +215,10 @@ export function getStackEventsQuery(request: GetStackEventsRequest) {
199
215
queryFn : async ( { signal } : { signal : AbortSignal } ) => {
200
216
const client = useFetchClient ( ) ;
201
217
const response = await client . getJSON < PersistentEvent [ ] > ( `stacks/${ request . route . stackId } /events` , {
202
- params : request . params ,
218
+ params : {
219
+ ...( DEFAULT_OFFSET ? { offset : DEFAULT_OFFSET } : { } ) ,
220
+ ...request . params
221
+ } ,
203
222
signal
204
223
} ) ;
205
224
0 commit comments