File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export async function createGame<TFacts>(
2828 {
2929 schema,
3030 roleAssigner,
31- } : { schema : yup . Schema < TFacts > ; roleAssigner ?: ( ix : number ) => any }
31+ } : { schema : yup . Schema < TFacts > ; roleAssigner ?: ( ix : number , facts : any ) => any }
3232) {
3333 const validatedFacts = schema . validateSync ( facts ) as any
3434
@@ -46,7 +46,7 @@ export async function createGame<TFacts>(
4646 return {
4747 facts : { } ,
4848 token : nanoid ( ) ,
49- role : roleAssigner ? roleAssigner ( ix ) : undefined ,
49+ role : roleAssigner ? roleAssigner ( ix , validatedFacts ) : undefined ,
5050 number : playerCount - ix ,
5151 name : `Team ${ playerCount - ix } ` ,
5252 level : {
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ interface GenerateBaseMutationsArgs {
2727 schemas ?: any
2828 inputTypes ?: any
2929 // TODO(JJ): return value should be unknown
30- roleAssigner ?: ( ix : number ) => any
30+ roleAssigner ?: ( ix : number , facts : any ) => any
3131}
3232
3333function hasCompletedCompanySetup (
You can’t perform that action at this time.
0 commit comments