Skip to content

Commit

Permalink
Merge pull request #52 from openhacku-team-a/fix-param-auth-id
Browse files Browse the repository at this point in the history
πŸ› (handler/milestone)Param -> GetString
  • Loading branch information
Shion1305 authored Mar 16, 2024
2 parents 3f9ad4c + 53db7b8 commit 2252b4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions svc/pkg/handler/milestone.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (m MileStone) PostMileStone() gin.HandlerFunc {
}
target := gModel.Milestone{
MilestoneID: uuid.New().String(),
UserID: c.Param(middleware.AuthorizedUserIDField),
UserID: c.GetString(middleware.AuthorizedUserIDField),
Title: milestoneCreateRequest.Milestone.Title,
Content: milestoneCreateRequest.Milestone.Content,
ImageHash: "",
Expand Down Expand Up @@ -107,7 +107,7 @@ func (m MileStone) UpdateMileStone() gin.HandlerFunc {

_, err = m.q.Milestone.WithContext(c).
Where(m.q.Milestone.MilestoneID.Eq(milestoneUpdateRequest.Milestone.MilestoneId),
m.q.Milestone.UserID.Eq(c.Param(middleware.AuthorizedUserIDField)),
m.q.Milestone.UserID.Eq(c.GetString(middleware.AuthorizedUserIDField)),
).Updates(
map[string]interface{}{
"title": milestoneUpdateRequest.Milestone.Title,
Expand Down

0 comments on commit 2252b4b

Please sign in to comment.