File tree Expand file tree Collapse file tree 4 files changed +41
-8
lines changed
Expand file tree Collapse file tree 4 files changed +41
-8
lines changed Original file line number Diff line number Diff line change 11import { AuthProtectedComponent } from "@/auth/auth.client" ;
2+ import NumberSpinner from "@/components/inputs/NumberSpinner" ;
23import { FrontendStageModules } from "@/stageModules/stageModules" ;
34import { SportEnum , Stage , UnionStage } from "@ipsc_scoreboard/api" ;
45import ArrowLeftIcon from "@mui/icons-material/ArrowLeft" ;
@@ -95,6 +96,20 @@ function CommonDataInput(props: StepComponenetProps) {
9596 } )
9697 }
9798 />
99+ < NumberSpinner
100+ label = { `Walkthrough / Preparation time (${ props . stageData . walkthroughTime ?? 0 } seconds / ${ (
101+ ( props . stageData . walkthroughTime ?? 0 ) / 60
102+ ) . toPrecision ( 2 ) } minutes)`}
103+ min = { 1 }
104+ step = { 1 }
105+ value = { props . stageData . walkthroughTime ?? 0 }
106+ onValueChange = { ( value ) =>
107+ props . setStageData ( {
108+ ...props . stageData ,
109+ walkthroughTime : value ?? 0 ,
110+ } )
111+ }
112+ />
98113 </ Stack >
99114 </ >
100115 ) ;
Original file line number Diff line number Diff line change @@ -87,11 +87,16 @@ export const MixinAaipscFrontendStageModule: MixableFrontendStageModule<
8787 ) ;
8888 }
8989
90+ //TODO: JSON.stringify should remove after https://github.com/elysiajs/eden/pull/229 is merged
9091 async submitStage ( data : EditingStageData < AaipscStage > ) {
91- const res = await api . stage . ipsc . post ( {
92+ const res = await api . stage . aaipsc . post ( {
9293 images : data . rawFiles ?? [ ] ,
93- ipscPaperTargets : data . aaipscPaperTargets ?? [ ] ,
94- ipscSteelTargets : data . aaipscSteelTargets ?? [ ] ,
94+ aaipscPaperTargets : JSON . stringify (
95+ data . aaipscPaperTargets ?? [ ] ,
96+ ) as unknown as [ ] ,
97+ aaipscSteelTargets : JSON . stringify (
98+ data . aaipscSteelTargets ?? [ ] ,
99+ ) as unknown as [ ] ,
95100 title : data . title ?? "" ,
96101 walkthroughTime : data . walkthroughTime ?? 0 ,
97102 description : data . description ,
Original file line number Diff line number Diff line change @@ -87,11 +87,16 @@ export const MixinIpscFrontendStageModule: MixableFrontendStageModule<
8787 ) ;
8888 }
8989
90+ //TODO: JSON.stringify should remove after https://github.com/elysiajs/eden/pull/229 is merged
9091 async submitStage ( data : EditingStageData < IpscStage > ) {
9192 const res = await api . stage . ipsc . post ( {
9293 images : data . rawFiles ?? [ ] ,
93- ipscPaperTargets : data . ipscPaperTargets ?? [ ] ,
94- ipscSteelTargets : data . ipscSteelTargets ?? [ ] ,
94+ ipscPaperTargets : JSON . stringify (
95+ data . ipscPaperTargets ?? [ ] ,
96+ ) as unknown as [ ] ,
97+ ipscSteelTargets : JSON . stringify (
98+ data . ipscSteelTargets ?? [ ] ,
99+ ) as unknown as [ ] ,
95100 title : data . title ?? "" ,
96101 walkthroughTime : data . walkthroughTime ?? 0 ,
97102 description : data . description ,
Original file line number Diff line number Diff line change 11import { StageDataInput } from "@/components/stage/StageDataInput" ;
22import {
33 UspsaPaperTarget ,
4+ UspsaScoringMethod ,
45 UspsaStage ,
56 UspsaSteelTarget ,
67} from "@ipsc_scoreboard/api" ;
@@ -87,11 +88,18 @@ export const MixinUspsaFrontendStageModule: MixableFrontendStageModule<
8788 ) ;
8889 }
8990
91+ //TODO: JSON.stringify should remove after https://github.com/elysiajs/eden/pull/229 is merged
9092 async submitStage ( data : EditingStageData < UspsaStage > ) {
91- const res = await api . stage . ipsc . post ( {
93+ const res = await api . stage . uspsa . post ( {
9294 images : data . rawFiles ?? [ ] ,
93- ipscPaperTargets : data . uspsaPaperTargets ?? [ ] ,
94- ipscSteelTargets : data . uspsaSteelTargets ?? [ ] ,
95+ uspsaPaperTargets : JSON . stringify (
96+ data . uspsaPaperTargets ?? [ ] ,
97+ ) as unknown as [ ] ,
98+ uspsaSteelTargets : JSON . stringify (
99+ data . uspsaSteelTargets ?? [ ] ,
100+ ) as unknown as [ ] ,
101+ uspsaScoringMethod :
102+ data . uspsaScoringMethod ?? UspsaScoringMethod . Comstock ,
95103 title : data . title ?? "" ,
96104 walkthroughTime : data . walkthroughTime ?? 0 ,
97105 description : data . description ,
You can’t perform that action at this time.
0 commit comments