Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jjnavanon/sucu 46 user get user by #15

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

JJnvn
Copy link

@JJnvn JJnvn commented Oct 13, 2024

Type of Change

  • New features
  • Bug fixes
  • Breaking changes
  • Refactor
  • Documentation updates
  • Other (please specify):

Description

create get user by id api

@wiraphatys wiraphatys changed the base branch from main to dev October 14, 2024 17:46
Comment on lines +7 to +8
bin = "./tmp/main.exe"
cmd = "go build -o ./tmp/main.exe ./cmd/main.go"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ฝากแก้ให้เหมือนเดิมด้วย bro ใน macos มันไม่มี .exe @JJnvn

u.logger.Named("GetUserByID").Error(constant.ErrInvalidRole, zap.String("role", req.Role), zap.Error(err))
return nil, apperror.ForbiddenError(constant.ErrInvalidRole)
}
res_return := dtos.UserDTO{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

แก้ชื่อตัวแปรให้เป็น camel ด้วยคับบ like resReturn

CreatedAt: res.CreatedAt,
UpdatedAt: res.UpdatedAt,
}
return &res_return, nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

นี่ด้วย

@@ -43,7 +43,13 @@ func (h *UserHandler) GetAllUsers(c *fiber.Ctx) error {
// @Failure 500 {object} response.Response
// @Router /users/{user_id} [get]
func (h *UserHandler) GetUserByID(c *fiber.Ctx) error {
return nil
userID := c.Params("user_id") // how to get this?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment plss

Comment on lines +49 to +52
if err != nil {
return err
}
return c.JSON(res)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ใช้ package responses เวลา return นะะ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants