David Ilizarov
10/05/2020, 9:10 AMdefault: boolean
. The model also has a userId: number
since it belongsTo a User. For any userId on the PaymentMethod, only 1 PaymentMethod can be true
.
Any simple way to manage this? Right now in my API calls, if a user wants to make a PaymentMethod default, I just query for that PaymentMethod and the current default PaymentMethod and set one to true and the other to false.
It is simple, basic and works, but curious to explore other options that can make this type of situation even simpler for me.Jan Wilhelm
10/05/2020, 9:17 AMAhmed
10/05/2020, 9:23 AMDavid Ilizarov
10/05/2020, 9:29 AM