-
Notifications
You must be signed in to change notification settings - Fork 0
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
[TM-812] Tree Species refactor #142
Conversation
…age doesn't need to load the entity too.
@@ -208,24 +242,31 @@ private function updateLinkedFieldValue(array $linkedFieldInfo, $answer): void | |||
} | |||
} | |||
|
|||
public function getForm(): Form | |||
private function syncRelation(string $property, $data): void |
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.
This is the real meat of this PR: Over the course of this epic, we'll be adding support for several (hopefully all) of these relations so that the BE is responsible for managing them, rather than putting that onus on the FE, requiring it to access a bunch of extra APIs. This is both for performance and practical reasons (see the note about the update request flow in the PR description).
[TM-812] Tree Species refactor
https://gfw.atlassian.net/browse/TM-812
FE: wri/wri-terramatch-website#116
This turns tree species into a BE concern by avoiding separate mutation endpoints for tree species (create/update/delete). The problem there was that in the update request flow, the tree species on the base entity would be updated without admin approval of the update request.
I've also started sideloading the update request on the form entity API response so that the FE doesn't need to load both endpoints in order to load the form.