-
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
Add Update Functionality for Collections #33
Comments
This changed a ton. So, instead of storing a list of strings in a field on the Collection table, I created a join table to store data about the relation and reduce the amount of data that needs to be sent across the network. There will only ever be one card id to one collection, with a count of how many of this card there are in the collection. When there are none, the relation is removed. |
Some known issues:
|
prisma.schema model Card {
id: uuid
}
model Collection {
id: uuid
}
model CardsOnCollections {
cardId: string
collectionId: string
@@id([collectionId, cardId])
} |
Implement the functionality to update an existing collection. This includes both frontend UI changes and backend API updates to support editing a collection's details. For now, focus on the
name
andcards
fields. Validation logic should be added to ensure updated data is correct and meaningful, but collection names will not be required to be unique for the MVP.Requirements:
Frontend:
UI Update Form:
name
: A text input field for the collection name.cards
: A multi-select or autocomplete dropdown to manage associated cards.Form Validation:
name
field is not empty and does not exceed a reasonable character limit (e.g., 50 characters).cards
field to ensure valid card data is submitted.Submit Changes:
Backend:
Update API Endpoint:
name
andcards
fields from the request.Validation Logic:
name
field is a valid string and not empty.cards
field contains valid card IDs (if applicable).Database Update:
updatedAt
field when configured in the schema.Error Handling:
Testing:
Acceptance Criteria:
updatedAt
field is updated automatically whenever a collection is modified.The text was updated successfully, but these errors were encountered: