JoeKennedy / fantasy

A Fantasy League Of Ice And Fire
6 stars 0 forks source link

Add a UUID to Event #41

Closed JoeKennedy closed 7 years ago

JoeKennedy commented 7 years ago

As I detailed a bit in #40, there's a bug creating duplicate events on the score page. This is because, right now, when a new event is added, it's submitted to the server and then created, and the resulting id is returned to the client. This id is then added as the value to the id field of that row. However, if a field in a row is changed before the id is returned, the interface will submit this as a separate event, hence creating a duplicate.

To get around this, I'll add a UUID field to Event. This can be generated as a unique value for each existing event; I believe this is something that's possible in Postgres. For new events on the score page, I'll need to add a value to this field as soon as the row is added, either with the Add More Events button or by copying another row. For new events on the event form, I'll need to generate this when generating the event form.

JoeKennedy commented 7 years ago

This was fixed by 46dc673775c70b69a85fc70372f42f9a9024c4d6; I forgot to mark it as such