You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a Customer and Supplier model that both implement an Addressable contract. Adding and editing addresses will be done through a modal. This won't be easy as we often only pass the id of a model to it. That's not be possible here.
There are a few ways I can think of:
Pass the class name and init it manually in the modal, but it's unsafe.
Use an Enum to identify the addressable object and pass its value. This is safer, but prone to errors when you add more Addressable implementations.
Are there any other safe ways to pass an Addressable implementation to this modal without exposing too much data?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We have a
Customer
andSupplier
model that both implement anAddressable
contract. Adding and editing addresses will be done through a modal. This won't be easy as we often only pass the id of a model to it. That's not be possible here.There are a few ways I can think of:
Addressable
implementations.Are there any other safe ways to pass an
Addressable
implementation to this modal without exposing too much data?Beta Was this translation helpful? Give feedback.
All reactions