Skip to content

Commit 9cb8a19

Browse files
authored
Update reference-models.md
Adds forgotten TypeBuilder imports
1 parent 9f4c219 commit 9cb8a19

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/patterns/reference-models.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ With reference models, you can named your model and use it by referencing the na
2121

2222
For example:
2323
```typescript
24-
import { Elysia } from 'elysia'
24+
import { Elysia, t } from 'elysia'
2525

2626
const app = new Elysia()
2727
.post('/sign-in', ({ body }) => body, {
@@ -38,7 +38,7 @@ const app = new Elysia()
3838

3939
We can make it cleaner, by declaring the model as a variable.
4040
```typescript
41-
import { Elysia } from 'elysia'
41+
import { Elysia, t } from 'elysia'
4242

4343
// Maybe in a different file eg. models.ts
4444
const SignDTO = t.Object({
@@ -62,7 +62,7 @@ You can make it a bit cleaner by creating a "reference model".
6262
Registering the models with `setModel` allows you to name a model and reference them directly in `schema` with auto-completion.
6363

6464
```typescript
65-
import { Elysia } from 'elysia'
65+
import { Elysia, t } from 'elysia'
6666

6767
const app = new Elysia()
6868
.model({
@@ -82,7 +82,7 @@ Now when we need to quickly access the model's group, we can separate a `setMode
8282

8383
```typescript
8484
// auth.model.ts
85-
import { Elysia } from 'elysia'
85+
import { Elysia, t } from 'elysia'
8686

8787
export const authModel = new Elysia()
8888
.model({
@@ -110,7 +110,7 @@ const app = new Elysia()
110110

111111
```typescript
112112
// auth.model.ts
113-
import { Elysia } from 'elysia'
113+
import { Elysia, t } from 'elysia'
114114

115115
export const authModel = new Elysia()
116116
.model({

0 commit comments

Comments
 (0)