We are building our backend in TS functions and we are defining enums for several fields on our objects (e.g. patient status).
Unfortunately, we are running into issues when there is a change on the enums in the backend, in the TS repo, which is not replicated on the front end.
To replicate the change, we need to identify all the places where we hardcoded this enum and then manually change every instance of it.
Of course, we are missing some fromt ime to time which is leading to errors.
Is there a way to share enums across the BE and FE ?
Do you have any recommendation or best practice to make this work?
This might not be the best way to solve your issue, but you could write a new TS function that returns the list of enums (keys and values) in a JSON struct. You could then define a new function-backed variable in Workshop that calls this function and stores the returned struct. Then, rather than hard-coding the enum, you can extract the desired enum key from the struct in order to get its enum value.