Move webformsEnabled to form_defs#1840
Open
sadiqkhoja wants to merge 3 commits into
Open
Conversation
a166d35 to
1e2183a
Compare
sadiqkhoja
commented
Jun 2, 2026
|
|
||
| const defFromRequest = Form.Def.fromApi(body); | ||
|
|
||
| await Forms._updateDef(form.def, defFromRequest); |
Member
matthew-white
left a comment
There was a problem hiding this comment.
Just a random thing I noticed while looking at the PR
Comment on lines
+257
to
+260
| await Forms._updateDef(form.def, defFromRequest); | ||
|
|
||
| const webformsEnabled = defFromRequest.webformsEnabled ?? form.def.webformsEnabled; | ||
| return { ...form.forApi(), webformsEnabled }; |
Member
There was a problem hiding this comment.
Do you think that updatedAt should change as part of this endpoint? Only forms has an updatedAt column, not form_defs, but I think (not sure) that we bump updatedAt when we change the form draft. My instinct is that updatedAt should change, but it means that this pattern of { ...form.forApi(), webformsEnabled } won't work.
2ad22af to
25a28a5
Compare
25a28a5 to
8613ae3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Towards getodk/central#1693
What has been done to verify that this works as intended?
Added tests + manual testing with corresponding changes in frontend code.
Why is this the best possible solution? Were any other approaches considered?
First commit had an approach where
webformsEnabledcolumn was only inform_defsbut the resulting code was quite complicated. Latest approach follows similar pattern that ofenketoId.How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
No
Does this change require updates to the API documentation? If so, please update docs/api.yaml as part of this PR.
Yes
Before submitting this PR, please make sure you have:
make testand confirmed all checks still pass, or witnessed Github completing all checks with success