Omar-7ioo
TTCTheo's Typesafe Cult
•Created by Omar-7ioo on 10/19/2024 in #questions
What is the standard way to fetch on RSC
create t3 app using App Router uses prefetch and hydrate client by default but why not use the caller instead? What is the benefit of prefetch?
4 replies
TTCTheo's Typesafe Cult
•Created by Omar-7ioo on 2/24/2024 in #questions
Static IP Address
I'm working as a seller in a company that provide API's for developers, it allows access to the API if you provided one.
The issue that I'm calling these API from a local machine and my IP changes all the time and I have to open a new ticket every time so I provide the new IP address.
- Is there a way to have a static IP address?
- Is there a workaround?
- do I have to buy a static IP address?
- Is there a service that provide what I want?
The app fetches the API and extract that data into a JSON file so I can do operations on it. (Node.js)
3 replies
TTCTheo's Typesafe Cult
•Created by Omar-7ioo on 11/7/2023 in #questions
Returning new Response
4 replies
TTCTheo's Typesafe Cult
•Created by Omar-7ioo on 11/6/2023 in #questions
TRPC pass res to ctx using app router
I used the template provided by trpc, ctx doesn't contain req or res. I managed to pass the req but couldn't figure out the res.
Create Context:
Handler
1 replies
TTCTheo's Typesafe Cult
•Created by Omar-7ioo on 9/1/2023 in #questions
Zod overrides react-hook-form validation
I have the following form scheme. When I specify rules={{required: true}} on the field it doesn't work because of zod validation scheme.
I want to be able to override Zod or being able to make field required based on api response (later on).
8 replies
TTCTheo's Typesafe Cult
•Created by Omar-7ioo on 9/1/2023 in #questions
React-hook-form fields based on API call.
I hit an API to get fields for a product. The field properties usually get defined before with Zod. The problem is if the API got changed it won't be in sync.
Example of the res data:
categoryAttributes.index.attribute.name should be the field name I suppose but how can I assign it to react-hook-form. I can't tell the name or if it required so I can make it as required in the form since it is an API call. I know the shape of the response only.
Is there a way around or I need to hard type them in the zod scheme and react-hook-form?
1 replies