feat: add endpoint for get branch admin
This commit is contained in:
parent
20cf11f988
commit
b89b9dce34
1 changed files with 17 additions and 0 deletions
|
|
@ -58,6 +58,23 @@ async function userBranchCodeGen(branch: Branch, user: User[]) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Route("api/v1/branch/{branchId}/admin")
|
||||||
|
@Tags("Branch User")
|
||||||
|
export class BranchAdminUserController extends Controller {
|
||||||
|
@Get()
|
||||||
|
@Security("keycloak")
|
||||||
|
async getBranchAdmin(@Path() branchId: string) {
|
||||||
|
return await prisma.user.findFirst({
|
||||||
|
where: {
|
||||||
|
branch: {
|
||||||
|
some: { branchId },
|
||||||
|
},
|
||||||
|
userRole: "branch_admin",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Route("api/v1/branch/{branchId}/user")
|
@Route("api/v1/branch/{branchId}/user")
|
||||||
@Tags("Branch User")
|
@Tags("Branch User")
|
||||||
export class BranchUserController extends Controller {
|
export class BranchUserController extends Controller {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue