feat: add update user data endpoint
This commit is contained in:
parent
6899c9823a
commit
addd4caa63
2 changed files with 51 additions and 3 deletions
|
|
@ -1,8 +1,14 @@
|
|||
import { Body, Controller, Delete, Get, Path, Post, Route, Security, Tags } from "tsoa";
|
||||
import { addUserRoles, createUser, getRoles, removeUserRoles } from "../services/keycloak";
|
||||
import { Body, Controller, Delete, Get, Path, Post, Put, Route, Security, Tags } from "tsoa";
|
||||
import {
|
||||
addUserRoles,
|
||||
createUser,
|
||||
editUser,
|
||||
getRoles,
|
||||
removeUserRoles,
|
||||
} from "../services/keycloak";
|
||||
|
||||
@Route("api/keycloak")
|
||||
@Tags("Keycloak")
|
||||
@Tags("Single-Sign On")
|
||||
@Security("keycloak")
|
||||
export class KeycloakController extends Controller {
|
||||
@Post("user")
|
||||
|
|
@ -15,6 +21,14 @@ export class KeycloakController extends Controller {
|
|||
});
|
||||
}
|
||||
|
||||
@Put("user/{userId}")
|
||||
async editUser(
|
||||
@Path() userId: string,
|
||||
@Body() body: { username?: string; password?: string; firstName?: string; lastName?: string },
|
||||
) {
|
||||
return await editUser(userId, body);
|
||||
}
|
||||
|
||||
@Get("role")
|
||||
async getRole() {
|
||||
const role = await getRoles();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue