typescript and trpc data validation
another noob question from me, but trying to figure out typescript.
So if I have a piece of code like this in my router:
and the data from this api url is really long , how should I go about typing it? I am not using the whole of the data, so is there a way to pick in trpc router only the data that I'm interested in?
3 Replies
Use typescripts Pick type helper
But do you mean I should use it to create data from all the objects inside this json? because there are a lot, also not sure how Pick works (newbie typescripter here)
to type data* sry
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View