-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement specific API for duplicating form fields #1907
Conversation
src/app/routes/api/v3/admin/forms/__tests__/admin-forms.form.routes.spec.ts
Outdated
Show resolved
Hide resolved
…min field in admin-forms.form.routes.specs.ts
src/app/routes/api/v3/admin/forms/__tests__/admin-forms.form.routes.spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! but add docs cos some stuff abit confusing
src/app/routes/api/v3/admin/forms/__tests__/admin-forms.form.routes.spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm after fixing typos
Problem
This PR creates a new endpoint
POST /api/v3/admin/forms/:formId/fields/:fieldId/duplicate
and extracts the functionality to duplicate form fields from the existing endpointPUT /:formId/adminform
.Closes #1483
Solution
admin-forms.form.routes.ts
: Added new endpointadmin-form.controller.ts
: AddedhandleDuplicateFormField
controlleradmin-form.service.ts
: AddedduplicateFormField
serviceform-server-model.ts
: AddedduplicateFormFieldById
UPDATE_FORM_TYPES
: AddedDuplicateField
admin-form.client.controller.js
: Added another case for duplication to call new API and update viewTests
Unit Tests
admin-form.controller.specs.ts
: add unit testshandleDuplicateFormField
admin-form.service.specs.ts
: add unit tests forduplicateFormField
admin-forms.form.routes.spec.ts
: add unit tests forPOST /:formId/fields/:fieldId/duplicate
form.server.model.spec.ts
: add unit tests forduplicateFormFieldById
instance methodManual Tests