@@ -30,7 +30,18 @@ export const groupRouter = router({
3030 createGroup : groupProcedure
3131 . input ( insertChatGroupSchema . omit ( { userId : true } ) )
3232 . mutation ( async ( { input, ctx } ) => {
33- return ctx . chatGroupModel . create ( input ) ;
33+ return ctx . chatGroupModel . create ( {
34+ ...input ,
35+ config : input . config as {
36+ maxResponseInRow ?: number ;
37+ orchestratorModel ?: string ;
38+ orchestratorProvider ?: string ;
39+ responseOrder ?: 'sequential' | 'natural' ;
40+ responseSpeed ?: 'slow' | 'medium' | 'fast' ;
41+ revealDM ?: boolean ;
42+ systemPrompt ?: string ;
43+ } | null | undefined ,
44+ } ) ;
3445 } ) ,
3546
3647 deleteGroup : groupProcedure
@@ -90,7 +101,18 @@ export const groupRouter = router({
90101 } ) ,
91102 )
92103 . mutation ( async ( { input, ctx } ) => {
93- return ctx . chatGroupModel . update ( input . id , input . value ) ;
104+ return ctx . chatGroupModel . update ( input . id , {
105+ ...input . value ,
106+ config : input . value . config as {
107+ maxResponseInRow ?: number ;
108+ orchestratorModel ?: string ;
109+ orchestratorProvider ?: string ;
110+ responseOrder ?: 'sequential' | 'natural' ;
111+ responseSpeed ?: 'slow' | 'medium' | 'fast' ;
112+ revealDM ?: boolean ;
113+ systemPrompt ?: string ;
114+ } | null | undefined ,
115+ } ) ;
94116 } ) ,
95117} ) ;
96118
0 commit comments