Skip to content

Commit e5c9449

Browse files
committed
🔧 fix: recursive macro with conflict value per status
1 parent 60bcb2e commit e5c9449

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

example/a.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const app = new Elysia()
3333
.model(Models)
3434
.macro('isAdmin', {
3535
isAuth: true,
36-
async resolve({ headers, status }) {
36+
async resolve({ headers, status, user }) {
3737
// Mock admin check logic
3838
if (Math.random() > 0.5) return status(403, 'Not allowed')
3939

@@ -46,7 +46,8 @@ const app = new Elysia()
4646
async updateUser({ id, ...rest }: Models['user.update']) {
4747
if (Math.random() > 0.5) return status(404, 'No user')
4848

49-
return { id }
49+
50+
return { id, by: user }
5051
}
5152
}
5253
}

0 commit comments

Comments
 (0)