1- import { createBBIssueWorkflow , generateBBToken } from "../utils" ;
1+ import { createBBIssueWorkflow , generateBBToken , grantUserRole } from "../utils" ;
22
33function generateRandomString ( length : number ) : string {
44 const characters = 'abcdefghijklmnopqrstuvwxyz' ;
@@ -45,7 +45,7 @@ export async function GET(request: Request) {
4545 console . error ( 'Failed to create user' , await createUserResponse . text ( ) ) ;
4646 throw new Error ( 'Failed to create user' ) ;
4747 }
48- console . log ( 'User created successfully in Bytebase' ) ;
48+ console . log ( 'User created successfully in Bytebase' , createUserResponse ) ;
4949
5050 // Create project using the username
5151 console . log ( `Creating project for user: ${ username } ` ) ;
@@ -70,11 +70,14 @@ export async function GET(request: Request) {
7070
7171 console . log ( 'User creation process completed successfully' ) ;
7272
73- console . log ( 'now create db' ) ;
73+ //console.log('now create db');
74+ //const result = await createBBIssueWorkflow(username)
75+ //console.log("after creating db", result)
7476
75- const result = await createBBIssueWorkflow ( username )
76- console . log ( "after creating db" , result )
7777
78+ // Grant the user project querier role
79+ const result = await grantUserRole ( username ) ;
80+ console . log ( "after grantUserRole" , result )
7881
7982 // Return the credentials and created project
8083 return new Response ( JSON . stringify ( {
0 commit comments