Skip to content

Commit 92d5187

Browse files
authored
fix @prisma types reference in tutorial
1 parent 184526b commit 92d5187

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/src/content/docs/tutorial/full-stack-app/5-jobs-list.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,14 +1294,14 @@ When you first set this up, you'll probably see an error
12941294
Our component isn't expecting the `applications` data we're passing it. Inside our `ApplicationsTable` component:
12951295

12961296
```tsx title="src/app/components/ApplicationsTable.tsx"
1297-
import { Application } from "@prisma/client"
1297+
import { Application } from "@generated/prisma/client"
12981298
...
12991299
const ApplicationsTable = ({ applications }: { applications: Application[] }) => {
13001300
```
13011301
13021302
- We'll set it up to receive the `applications` data as a prop.
13031303
- 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`.
13051305
13061306
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:
13071307
@@ -1388,7 +1388,7 @@ You might need to temporarily comment out the `Badge` component inside the `Appl
13881388

13891389
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.
13901390

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.
13921392

13931393
We could use the `&` to create a new type that has `status` and `company`. Contacts is an array, nested inside the `company` object.
13941394

@@ -1404,7 +1404,7 @@ type ApplicationWithRelations = (Application & {
14041404
However, Prisma has a special way to do this.
14051405

14061406
```tsx showLineNumbers=false
1407-
import { Prisma } from "@prisma/client"
1407+
import { Prisma } from "@generated/prisma/client"
14081408
...
14091409
export type ApplicationWithRelations = Prisma.ApplicationGetPayload<{
14101410
include: {
@@ -1453,7 +1453,7 @@ If this starts to feel a little overwhelming, a few things that have helped me:
14531453
Awesome. Let's add our `ApplicationWithRelations` at the top of our `List.tsx` file. This goes _outside_ the component definition:
14541454

14551455
```tsx title="src/app/pages/applications/List.tsx" showLineNumbers=false
1456-
import { Prisma } from "@prisma/client"
1456+
import { Prisma } from "@generated/prisma/client"
14571457
...
14581458
export type ApplicationWithRelations = Prisma.ApplicationGetPayload<{
14591459
include: {

0 commit comments

Comments
 (0)