We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60bcb2e commit e5c9449Copy full SHA for e5c9449
example/a.ts
@@ -33,7 +33,7 @@ const app = new Elysia()
33
.model(Models)
34
.macro('isAdmin', {
35
isAuth: true,
36
- async resolve({ headers, status }) {
+ async resolve({ headers, status, user }) {
37
// Mock admin check logic
38
if (Math.random() > 0.5) return status(403, 'Not allowed')
39
@@ -46,7 +46,8 @@ const app = new Elysia()
46
async updateUser({ id, ...rest }: Models['user.update']) {
47
if (Math.random() > 0.5) return status(404, 'No user')
48
49
- return { id }
+
50
+ return { id, by: user }
51
}
52
53
0 commit comments