@@ -2,25 +2,25 @@ import { Static, Type } from "@sinclair/typebox";
2
2
import { FastifyInstance } from "fastify" ;
3
3
import { StatusCodes } from "http-status-codes" ;
4
4
import { updatePermissions } from "../../../../db/permissions/updatePermissions" ;
5
- import { PermissionsSchema } from "../../../schemas/auth" ;
5
+ import { permissionsSchema } from "../../../schemas/auth" ;
6
6
import { standardResponseSchema } from "../../../schemas/sharedApiSchemas" ;
7
7
8
- const BodySchema = Type . Object ( {
8
+ const requestBodySchema = Type . Object ( {
9
9
walletAddress : Type . String ( ) ,
10
- permissions : PermissionsSchema ,
10
+ permissions : permissionsSchema ,
11
11
label : Type . Optional ( Type . String ( ) ) ,
12
12
} ) ;
13
13
14
- const ReplySchema = Type . Object ( {
14
+ const responseBodySchema = Type . Object ( {
15
15
result : Type . Object ( {
16
16
success : Type . Boolean ( ) ,
17
17
} ) ,
18
18
} ) ;
19
19
20
20
export async function grantPermissions ( fastify : FastifyInstance ) {
21
21
fastify . route < {
22
- Body : Static < typeof BodySchema > ;
23
- Reply : Static < typeof ReplySchema > ;
22
+ Body : Static < typeof requestBodySchema > ;
23
+ Reply : Static < typeof responseBodySchema > ;
24
24
} > ( {
25
25
method : "POST" ,
26
26
url : "/auth/permissions/grant" ,
@@ -29,10 +29,10 @@ export async function grantPermissions(fastify: FastifyInstance) {
29
29
description : "Grant permissions to a user" ,
30
30
tags : [ "Permissions" ] ,
31
31
operationId : "grant" ,
32
- body : BodySchema ,
32
+ body : requestBodySchema ,
33
33
response : {
34
34
...standardResponseSchema ,
35
- [ StatusCodes . OK ] : ReplySchema ,
35
+ [ StatusCodes . OK ] : responseBodySchema ,
36
36
} ,
37
37
} ,
38
38
handler : async ( req , res ) => {
0 commit comments