File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -329,7 +329,13 @@ function createIntervalsTools(
329329 category : [ "WORKOUT" ] ,
330330 } ) ;
331331 if ( ! result . ok ) return { error : result . error . kind } ;
332- return result . value ;
332+ return result . value . map ( ( e ) => ( {
333+ id : e . id ,
334+ start_date_local : e . start_date_local ,
335+ name : e . name ,
336+ moving_time : e . moving_time ,
337+ icu_training_load : e . icu_training_load ,
338+ } ) ) ;
333339 } ,
334340 } ) ,
335341
@@ -356,7 +362,7 @@ function createIntervalsTools(
356362 } ) ;
357363 if ( ! res . ok ) {
358364 const body = await res . text ( ) . catch ( ( ) => "" ) ;
359- return { error : `http_${ res . status } ` , message : body || res . statusText } ;
365+ return { error : `http_${ res . status } ` , details : body || res . statusText } ;
360366 }
361367 return { deleted : true } ;
362368 } ,
Original file line number Diff line number Diff line change @@ -355,8 +355,7 @@ export function createMockIntervalsServer(options: MockIntervalsOptions = {}) {
355355 return HttpResponse . json ( { id : eventId , ...body } , { status : 200 } ) ;
356356 } ) ,
357357
358- // GET /api/v1/athlete/:id/events — list scheduled events (filters created workouts
359- // by optional oldest/newest query params; ignores category since we only emit WORKOUT)
358+ // GET /api/v1/athlete/:id/events — list scheduled events
360359 http . get ( "https://intervals.icu/api/v1/athlete/:id/events" , ( { request } ) => {
361360 const url = new URL ( request . url ) ;
362361 const oldest = url . searchParams . get ( "oldest" ) ;
@@ -372,8 +371,7 @@ export function createMockIntervalsServer(options: MockIntervalsOptions = {}) {
372371 return HttpResponse . json ( filtered ) ;
373372 } ) ,
374373
375- // DELETE /api/v1/athlete/:id/events/:eventId — delete scheduled event; honors
376- // ?notBefore=YYYY-MM-DD by rejecting when the event's date is earlier.
374+ // DELETE /api/v1/athlete/:id/events/:eventId — delete scheduled event (honors ?notBefore)
377375 http . delete (
378376 "https://intervals.icu/api/v1/athlete/:id/events/:eventId" ,
379377 ( { request, params } ) => {
You can’t perform that action at this time.
0 commit comments