@@ -9,6 +9,7 @@ import { $SessionType } from '@opendatacapture/schemas/session';
99import type { CreateSessionData } from '@opendatacapture/schemas/session' ;
1010import { $SubjectIdentificationMethod } from '@opendatacapture/schemas/subject' ;
1111import type { Sex , SubjectIdentificationMethod } from '@opendatacapture/schemas/subject' ;
12+ import type { User } from '@opendatacapture/schemas/user' ;
1213import { encodeScopedSubjectId , generateSubjectHash } from '@opendatacapture/subject-utils' ;
1314import type { Promisable } from 'type-fest' ;
1415import { z } from 'zod/v4' ;
@@ -32,12 +33,19 @@ type StartSessionFormData = {
3233
3334type StartSessionFormProps = {
3435 currentGroup : Group | null ;
36+ currentUser : User | null ;
3537 initialValues ?: FormTypes . PartialNullableData < StartSessionFormData > ;
3638 onSubmit : ( data : CreateSessionData ) => Promisable < void > ;
3739 readOnly : boolean ;
3840} ;
3941
40- export const StartSessionForm = ( { currentGroup, initialValues, readOnly, onSubmit } : StartSessionFormProps ) => {
42+ export const StartSessionForm = ( {
43+ currentGroup,
44+ currentUser,
45+ initialValues,
46+ readOnly,
47+ onSubmit
48+ } : StartSessionFormProps ) => {
4149 const { resolvedLanguage, t } = useTranslation ( ) ;
4250 return (
4351 < Form
@@ -244,6 +252,7 @@ export const StartSessionForm = ({ currentGroup, initialValues, readOnly, onSubm
244252 await onSubmit ( {
245253 date : sessionDate ,
246254 groupId : currentGroup ?. id ?? null ,
255+ userId : currentUser ?. id ?? null ,
247256 type : sessionType ,
248257 subjectData : {
249258 id : subjectId ,
0 commit comments