-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
yayy first sprint of the sem!! 🥳
This week (aside from fixing your old sprint), you’ll be updating our ranked_cards column in the adopter_applications_dummy table to be an array of strings with the 4 matched inmate’s IDs.
Currently, it’s a column of JSON arrays that is upserted to the table in findMatches.ts, which was introduced in Jinkang’s PR last sem. To fix this,
- Update
findMatches.tsto only upsert the IDs. - Update
ApplicationState - Create a new function in
query.tscalledfetchAdopteeCardsInfothat takes in an array of inmate IDs and returns the information needed for rendering each card in theRankedAdopteeMatch[]format. We’ll probably add an age col in the future but just calculate it for now. - Update the components (like
MatchingCard.tsx) that rely on the current JSON format for rendering the adoptee cards to now use your new query. - Make the necessary changes to the table, and regenerate the types in
database.types.tsto match. If you haven’t regenerated types before: make sure you define PROJECT_ID in your .env file, login with the Supabase CLI, then runpnpm gen-schema.
Feel free to clear the data for that col in adopter_applications_dummy if it gives you errors, and then test those rows by using the app IDs.
Let me know if you have questions!
Reactions are currently unavailable