Conversation
…d implement POST function for trees table.
…ns, and missing credentials in POST request.
seanmnguyen
approved these changes
Jan 21, 2026
Collaborator
seanmnguyen
left a comment
There was a problem hiding this comment.
Nice work! Thanks for implementing the auth client and tokens! You're one step ahead of us haha
For future reference with the PR template, please delete the things inside the curly braces {...} and replace it with your content. For the issue linking specifically, you can just do "Closes #4" and that will automatically link to the issue (no need to manually add the link with markdown!)
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Developer: {David Benshachar}
Closes
#{4}Pull Request Summary
Adds authentication method for future POST requests by using function that creates a client using bearer tokens. Adds POST function with error handling to insert requests into tree table on supabase.
Modifications
Modified supabase-client.ts to add createAuthenticatedClient which creates a client using the bearer token. Modified api/admin/trees/route.ts to include POST method with documentation.
Testing Considerations
I have tested removing required parts of the body for insertions as well as including or removing optional parts of the body. I have verified that the error handling for these cases is correct. In addition, I have tested invalid and expired bearer tokens for authentication. This testing has verified that the request can insert parts into the "trees" table on supabase.
Pull Request Checklist
Screenshots/Screencast
{put screenshots of your change, or even better a screencast displaying the functionality}