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
Hi,
sometimes API returns consistently data in not practical format, so I want to postprocess specific field types globally for whole client.
Example:
All datetime fields are returned in ISO string, but everywhere I will need it as a Luxon DateTime object.
JSON fields with geo place want to just type from any to custom TS interface.
For this I would like to attach hook to the client where I can specify what fields to alter (e.g. all fields with name ending place and type JSONField) and specify process callback and expected resulting TS type.
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
-
Hi,
sometimes API returns consistently data in not practical format, so I want to postprocess specific field types globally for whole client.
Example:
any
to custom TS interface.For this I would like to attach hook to the client where I can specify what fields to alter (e.g. all fields with name ending
place
and type JSONField) and specify process callback and expected resulting TS type.Beta Was this translation helpful? Give feedback.
All reactions