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
- We'll set it up to receive the `applications` data as a prop.
1303
1303
- Then, we need to set the type. Fortunate for us, Prisma generates these for us. So, we can use the `Application` type and since there's an array of them, we'll use square brackets `[]`.
1304
-
- At the top of our, file we can import the `Application` type from `@prisma/client`.
1304
+
- At the top of our, file we can import the `Application` type from `@generated/prisma/client`.
1305
1305
1306
1306
Now, let's go down to our `TableBody`. First we want to loop over all the applications within our `applications` array and display a row in the table for each:
1307
1307
@@ -1388,7 +1388,7 @@ You might need to temporarily comment out the `Badge` component inside the `Appl
1388
1388
1389
1389
Now, if we go back to our `ApplicationsTable.tsx` file, the TypeScript error is still there. We're getting the `status` information now, but we need to make sure the type is updated to include it.
1390
1390
1391
-
We're already getting the `Application` type from `@prisma/client`. We need a way to also include the `ApplicationStatus`, `Company`, and `Contact` types.
1391
+
We're already getting the `Application` type from `@generated/prisma/client`. We need a way to also include the `ApplicationStatus`, `Company`, and `Contact` types.
1392
1392
1393
1393
We could use the `&` to create a new type that has `status` and `company`. Contacts is an array, nested inside the `company` object.
1394
1394
@@ -1404,7 +1404,7 @@ type ApplicationWithRelations = (Application & {
1404
1404
However, Prisma has a special way to do this.
1405
1405
1406
1406
```tsx showLineNumbers=false
1407
-
import {Prisma} from "@prisma/client"
1407
+
import {Prisma} from "@generated/prisma/client"
1408
1408
...
1409
1409
export type ApplicationWithRelations = Prisma.ApplicationGetPayload<{
1410
1410
include: {
@@ -1453,7 +1453,7 @@ If this starts to feel a little overwhelming, a few things that have helped me:
1453
1453
Awesome. Let's add our `ApplicationWithRelations` at the top of our `List.tsx` file. This goes _outside_ the component definition:
0 commit comments