11/* eslint-disable perfectionist/sort-objects */
22
3+ import type { CurrentUser } from '@/store/types' ;
34import { Form } from '@douglasneuroinformatics/libui/components' ;
45import { useTranslation } from '@douglasneuroinformatics/libui/hooks' ;
56import type { FormTypes } from '@opendatacapture/runtime-core' ;
@@ -9,7 +10,6 @@ import { $SessionType } from '@opendatacapture/schemas/session';
910import type { CreateSessionData } from '@opendatacapture/schemas/session' ;
1011import { $SubjectIdentificationMethod } from '@opendatacapture/schemas/subject' ;
1112import type { Sex , SubjectIdentificationMethod } from '@opendatacapture/schemas/subject' ;
12- import type { User } from '@opendatacapture/schemas/user' ;
1313import { encodeScopedSubjectId , generateSubjectHash } from '@opendatacapture/subject-utils' ;
1414import type { Promisable } from 'type-fest' ;
1515import { z } from 'zod/v4' ;
@@ -33,7 +33,7 @@ type StartSessionFormData = {
3333
3434type StartSessionFormProps = {
3535 currentGroup : Group | null ;
36- currentUser : User | null ;
36+ currentUser : CurrentUser | null ;
3737 initialValues ?: FormTypes . PartialNullableData < StartSessionFormData > ;
3838 onSubmit : ( data : CreateSessionData ) => Promisable < void > ;
3939 readOnly : boolean ;
@@ -252,7 +252,7 @@ export const StartSessionForm = ({
252252 await onSubmit ( {
253253 date : sessionDate ,
254254 groupId : currentGroup ?. id ?? null ,
255- userId : currentUser ?. id ?? null ,
255+ userId : currentUser ?. username ?? null ,
256256 type : sessionType ,
257257 subjectData : {
258258 id : subjectId ,
0 commit comments