-
Notifications
You must be signed in to change notification settings - Fork 87
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: add getQuestion instance method to form field schema #103
Conversation
Tests fixed. |
was causing schema building to fail due to expecting a document instead of an object
1476f87
to
0f31d59
Compare
}) | ||
}) | ||
|
||
const createAndReturnFormField = async (formFieldParams, formType) => { |
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.
the need for this is telling me that we're missing a factory method to create form field objects - we should eventually put one on FieldSchema
.
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.
Yes, since FormFields
are not registered as a model, we can't create them directly. Wouldn't creating a method still require the model to be registered?
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
Problem
Whilst migrating
utils/question.js
, realise that exported function can be inlined into the base field schema instead.This PR adds a new instance method
getQuestion()
to retrieve the question for display in form responses.Tests are also added for the new instance method.
Related to #8
Solution
Features:
utils/question
withFormField.methods.getQuestion
to retrieve questions of form fields.utils/question
is deletedBug fixes:
column
array.Tests
${title} (${column titles separated by comma})