Adrian Lysakowski
Adrian Lysakowski
TtRPC
Created by Adrian Lysakowski on 8/30/2023 in #❓-help
External calls
you could do a fetch, inside "server" component, instead of trpc, but then if ur logic later on in trpc actually depends on response, then it doesn't make sense to have call in component await and then pass it to trpc route 😄 as in my case once i got response i need to save those users in my db as well 😄 so it very valid to have it all together inside the method of trpc route
16 replies
TtRPC
Created by Adrian Lysakowski on 8/30/2023 in #❓-help
External calls
No description
16 replies
TtRPC
Created by Adrian Lysakowski on 8/30/2023 in #❓-help
External calls
cuz i will see it simply in network tab in request, of the headers that will include ur private tokens
16 replies
TtRPC
Created by Adrian Lysakowski on 8/30/2023 in #❓-help
External calls
@mfaizan1 it depends, if u call public extarnal API then it's fine, u can use react query, but if that's the request where u need to pass some "tokens" which are private ones, u can't use react query, as then me using ur app can steal it
16 replies
TtRPC
Created by Adrian Lysakowski on 8/30/2023 in #❓-help
External calls
so the logic is on UI -> fill in user information -> call trpc users route create method on Server -> method inside first try to create users in clerk using fetch -> await response, check if all good -> save created user in my db using with additional property clerkUserId from the response of fetch
16 replies
TtRPC
Created by Adrian Lysakowski on 8/30/2023 in #❓-help
External calls
it works super fine, in case of problem with request i am throwing simply 5XX error that users couldn't be created so further part of logic which then do relation in db is not being executed
16 replies
TtRPC
Created by Adrian Lysakowski on 8/30/2023 in #❓-help
External calls
my component is client side component using trpc so there is no othey way than having it in one of trpc route
16 replies
TtRPC
Created by Adrian Lysakowski on 8/30/2023 in #❓-help
External calls
call should be inside trpc, or anywhere on "server" side, as u will need to send them token inside request
16 replies
TtRPC
Created by Adrian Lysakowski on 8/30/2023 in #❓-help
External calls
nah but i figured it out myself
16 replies