Watts-Lab / researcher-portal

deliberation lab collaborator tools
0 stars 0 forks source link

Figure out how to reuse zod types for form inputs #44

Closed JamesPHoughton closed 2 months ago

JamesPHoughton commented 4 months ago

As a developer, I want to use existing types for different objects when possible, to save the work (and potential mistakes) of redefining them.

We are using zod to create validators for the treatment syntax (still in progress). We can use zod to convert these to types to use in the various forms.

christabusho commented 3 months ago

We adjusted the zod schemas that were created in the deliberation-empirica repo to satisfy the properties needed for both the validation for the forms and in empirica. We also added schemas needed only in the form so we can import them in the addPopup file (by adding the empirica repo as a submodule) and use them as part of updating the addPopup using the react hook form

JamesPHoughton commented 3 months ago

Just need to merge changes and test

JamesPHoughton commented 3 months ago

issue with bringing teh submodule up to date, ready to review pr

JamesPHoughton commented 3 months ago

https://github.com/Watts-Lab/deliberation-empirica/pull/865/files