-
Notifications
You must be signed in to change notification settings - Fork 7
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
MAUI-859: Enable Project Creation #4036
Conversation
Have also realised that I should write up a unit test, which I have not done yet. |
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 so far, nice one, just a few qs around entity types and some suggestions
packages/central-server/src/apiV2/utilities/constructNewRecordValidationRules.js
Show resolved
Hide resolved
packages/central-server/src/apiV2/utilities/constructNewRecordValidationRules.js
Show resolved
Hide resolved
packages/central-server/src/apiV2/utilities/constructNewRecordValidationRules.js
Outdated
Show resolved
Hide resolved
@IgorNadj this is ready to review again. Note that there is no specific rollback unit test. |
|
||
async createProjectEntityRelations(models, code, countries) { | ||
const { id: projectEntityId } = await models.entity.findOne({ | ||
'entity.code': code, |
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.
Minor: you don't need to prefix things here, you can just do { code: code }
, same with others below
}); | ||
} | ||
|
||
async createProjectEntityRelations(models, code, countries) { |
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.
Suggest we rename code
argument to projectCode
? Took me a little bit of time to figure out what this was
const worldCode = 'World'; | ||
const { id: worldId } = await models.entity.findOne({ 'entity.code': worldCode }); | ||
|
||
await models.entity.create({ |
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.
Minor: .create()
returns the record with an id, so you can return that instead of querying again to get it above on line 42. Same with the others
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.
Only minor comments left, nice one 🏌️
Thanks for the feedback @IgorNadj |
Issue MAUI-859:
Changes:
Screenshots: