33import { useCurrentStatus } from '@/hooks/useCurrentStatus/useCurrentStatus' ;
44import useUmami from '@/hooks/useUmami/useUmami' ;
55import { CheckinInput } from '@/traewelling-sdk/functions/trains' ;
6- import { Station , Stop } from '@/traewelling-sdk/types' ;
6+ import { Station , Stopover } from '@/traewelling-sdk/types' ;
77import { AboardTrip } from '@/types/aboard' ;
88import { Session } from 'next-auth' ;
99import { useSession } from 'next-auth/react' ;
@@ -49,12 +49,12 @@ const post = async (status: CheckinInput, session?: Session | null) => {
4949const CheckIn = ( ) => {
5050 const { data : session } = useSession ( ) ;
5151 const [ departureTime , setDepartureTime ] = useState < string > ( ) ;
52- const [ destination , setDestination ] = useState < Stop > ( ) ;
52+ const [ destination , setDestination ] = useState < Stopover > ( ) ;
5353 const [ error , setError ] = useState < string > ( ) ;
5454 const [ isOpen , setIsOpen ] = useState ( false ) ;
5555 const [ message , setMessage ] = useState ( '' ) ;
5656 const [ origin , setOrigin ] =
57- useState < Pick < Station , 'id' | 'ibnr' | 'name' | 'rilIdentifier' > > ( ) ;
57+ useState < Station > ( ) ;
5858 const [ query , setQuery ] = useState ( '' ) ;
5959 const [ step , setStep ] = useState < CheckInStep > ( 'origin' ) ;
6060 const [ travelType , setTravelType ] = useState ( 0 ) ;
@@ -73,10 +73,9 @@ const CheckIn = () => {
7373 body : message ,
7474 business : travelType ,
7575 departure : trip ?. departure ?. planned ! ,
76- destination : destination ! . evaIdentifier ,
77- ibnr : true ,
76+ destination : destination ! . id ,
7877 lineName : trip ! . line . name ,
79- start : trip ?. departureStation ?. ibnr ! ,
78+ start : trip ?. departureStation ?. trwlId ?? - 1 ,
8079 tripId : trip ! . hafasId ! ,
8180 visibility : visibility ,
8281 } ,
0 commit comments