Skip to content
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

Merged
merged 7 commits into from
Apr 15, 2024
Merged

[TM-812] Tree Species refactor #142

merged 7 commits into from
Apr 15, 2024

Conversation

roguenet
Copy link
Collaborator

@roguenet roguenet commented Apr 13, 2024

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.

@@ -208,24 +242,31 @@ private function updateLinkedFieldValue(array $linkedFieldInfo, $answer): void
}
}

public function getForm(): Form
private function syncRelation(string $property, $data): void
Copy link
Collaborator Author

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).

@roguenet roguenet merged commit 1d50364 into staging Apr 15, 2024
1 check passed
@roguenet roguenet deleted the feat/TM-812-tree-species branch April 15, 2024 15:55
egrojMonroy pushed a commit that referenced this pull request Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants