feat: update save user for non login
This commit is contained in:
parent
96fb556624
commit
c4c520866b
|
|
@ -138,7 +138,7 @@ func (_i *usersController) ShowInfo(c *fiber.Ctx) error {
|
||||||
// @Description API for create Users
|
// @Description API for create Users
|
||||||
// @Tags Users
|
// @Tags Users
|
||||||
// @Security Bearer
|
// @Security Bearer
|
||||||
// @Param Authorization header string true "Insert your access token" default(Bearer <Add access token here>)
|
// @Param Authorization header string false "Insert your access token" default(Bearer <Add access token here>)
|
||||||
// @Param payload body request.UsersCreateRequest true "Required payload"
|
// @Param payload body request.UsersCreateRequest true "Required payload"
|
||||||
// @Success 200 {object} response.Response
|
// @Success 200 {object} response.Response
|
||||||
// @Failure 400 {object} response.BadRequestError
|
// @Failure 400 {object} response.BadRequestError
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,12 @@ func (_i *usersService) Save(req request.UsersCreateRequest, authToken string) (
|
||||||
_i.Log.Info().Interface("data", req).Msg("")
|
_i.Log.Info().Interface("data", req).Msg("")
|
||||||
newReq := req.ToEntity()
|
newReq := req.ToEntity()
|
||||||
|
|
||||||
|
_i.Log.Info().Interface("AUTH TOKEN", authToken).Msg("")
|
||||||
|
|
||||||
|
if authToken != "" {
|
||||||
createdBy := utilSvc.GetUserInfo(_i.Log, _i.Repo, authToken)
|
createdBy := utilSvc.GetUserInfo(_i.Log, _i.Repo, authToken)
|
||||||
newReq.CreatedById = &createdBy.ID
|
newReq.CreatedById = &createdBy.ID
|
||||||
|
}
|
||||||
|
|
||||||
keycloakId, err := _i.Keycloak.CreateUser(req.Fullname, req.Email, req.Username, req.Password)
|
keycloakId, err := _i.Keycloak.CreateUser(req.Fullname, req.Email, req.Username, req.Password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -8187,8 +8187,7 @@ const docTemplate = `{
|
||||||
"default": "Bearer \u003cAdd access token here\u003e",
|
"default": "Bearer \u003cAdd access token here\u003e",
|
||||||
"description": "Insert your access token",
|
"description": "Insert your access token",
|
||||||
"name": "Authorization",
|
"name": "Authorization",
|
||||||
"in": "header",
|
"in": "header"
|
||||||
"required": true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "Required payload",
|
"description": "Required payload",
|
||||||
|
|
|
||||||
|
|
@ -8176,8 +8176,7 @@
|
||||||
"default": "Bearer \u003cAdd access token here\u003e",
|
"default": "Bearer \u003cAdd access token here\u003e",
|
||||||
"description": "Insert your access token",
|
"description": "Insert your access token",
|
||||||
"name": "Authorization",
|
"name": "Authorization",
|
||||||
"in": "header",
|
"in": "header"
|
||||||
"required": true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "Required payload",
|
"description": "Required payload",
|
||||||
|
|
|
||||||
|
|
@ -6023,7 +6023,6 @@ paths:
|
||||||
description: Insert your access token
|
description: Insert your access token
|
||||||
in: header
|
in: header
|
||||||
name: Authorization
|
name: Authorization
|
||||||
required: true
|
|
||||||
type: string
|
type: string
|
||||||
- description: Required payload
|
- description: Required payload
|
||||||
in: body
|
in: body
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue