Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Change response of /api/v1/forms/:id/make-live#793

Merged
lfdebrux merged 1 commit into
mainfrom
ldeb-fix-make-live
Jul 10, 2025
Merged

Change response of /api/v1/forms/:id/make-live#793
lfdebrux merged 1 commit into
mainfrom
ldeb-fix-make-live

Conversation

@lfdebrux
Copy link
Copy Markdown
Contributor

What problem does this pull request solve?

forms-admin had been assuming that the response from POST-ing to the make_live endpoint is a form object (see for instance https://github.com/alphagov/forms-admin/blob/4ce3b3473dcc48627cf387de156f37d06126a91e/app/services/form_repository.rb#L34-L43), but it's actually the made live form document. This is less useful because it doesn't contain the state (the attribute that is actually changed), and differs from the response that we get from the archive endpoint, even though they're the conceptually similar actions.

This commit changes the response to be the updated form object as expected.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Has all relevant documentation been updated?

forms-admin had been assuming that the response from POST-ing to the
make_live endpoint is a form object, but it's actually the made live
form document. This is less useful because it doesn't contain the state
(the attribute that is actually changed), and differs from the response
that we get from the archive endpoint, even though they're the
conceptually similar actions.

This commit changes the response to be the updated form object as
expected.
@sonarqubecloud
Copy link
Copy Markdown

@lfdebrux lfdebrux merged commit 254b9fc into main Jul 10, 2025
5 checks passed
@lfdebrux lfdebrux deleted the ldeb-fix-make-live branch July 10, 2025 12:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants