Skip to content

Commit 047bcfd

Browse files
committed
chore(with-fastify): spread duplicated schema
1 parent dc8a71c commit 047bcfd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/with-fastify/src/api/posts/posts.controller.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export function postsController(
3535

3636
const post = user.findPost(postId)
3737
if (!post) return reply.status(404).send('Post not found')
38+
3839
return post
3940
}
4041
)
@@ -53,6 +54,7 @@ export function postsController(
5354
)
5455
user.addPost(post)
5556
await service.write()
57+
5658
return post
5759
}
5860
)

examples/with-fastify/src/api/posts/posts.schema.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ export const userIdParamsSchema = {
88

99
export const userIdAndPostIdParamsSchema = {
1010
params: {
11-
userId: {
12-
$ref: 'User#/properties/userId'
13-
},
11+
...userIdParamsSchema.params,
1412
postId: {
1513
$ref: 'Post#/properties/postId'
1614
}

0 commit comments

Comments
 (0)