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.
ℹ️ Issue
Part one of two for #34
📝 Description
Big changes:
Changed backend and frontend schema so zipcode is a string (if it's a number, it strips out leading 0's)
Added a top-level
id
field to each document - this is generated byuuid
prior to insertion of the document in the databaseAdded a top-level
adminNotes
field on the schema (for future work on Create PATCH endpoint to update a single form #36 tbh I just got lazy about separating commits) - this defaults to an empty array on the frontend form pageAdded a get endpoint on the backend to fetch form details using the ID of a document - @Mo-sissoko this endpoint will also have to be protected!
Updated the
formData
type to match the validation schema used on the frontend - this required a small change to @reardon-co 's work on the hook inuseSortingAndFiltering.ts
Created a new frontend page at
/form/{documentID}
✔️ Verification
apps/backend
runnpm run build && sam deploy --guided --capabilities CAPABILITY_NAMED_IAM
BASE_URL
inendpoints.ts
to be the URL of the newly deployed backend.nx serve frontend
from the root project directorylocalhost:4200/form
and submit a formselect * from TestTable;
localhost:4200/form/{id}
Page when the document ID doesn't exist / something goes wrong with fetching the data:
🏕️ (Optional) Future Work / Notes