ictsc / ictsc-rikka

score-server backend in ictsc
0 stars 0 forks source link

プロフィールが更新できないバグ #36

Closed K-shir0 closed 3 years ago

K-shir0 commented 3 years ago

概要

リクエスト & レスポンス 詳細

PUT /api/users:id

Request

{
   "id":"faecfd39-d5bd-41c4-8924-3e59ec1de078",
   "display_name":"adminaaaasdfasfd",
   "twitter_id":"K_shir122",
   "github_id":"sdfasfd",
   "facebook_id":"asdfasfd",
   "self_introduction":"sdfasfasf"
}

Response

{
   "code":202,
   "data":{
      "user":{
         "id":"faecfd39-d5bd-41c4-8924-3e59ec1de078",
         "created_at":"2021-08-09T14:46:40.088Z",
         "updated_at":"2021-08-16T08:40:35.162Z",
         "name":"admin",
         "display_name":"adminaaaasdfasfd",
         "user_group_id":"3d0e36bb-4bf5-4fea-8c21-e8bf798b1076",
         "user_group":{
            "id":"3d0e36bb-4bf5-4fea-8c21-e8bf798b1076",
            "created_at":"2021-08-09T14:46:39.945Z",
            "updated_at":"2021-08-09T14:46:39.945Z",
            "name":"admin-group",
            "organization":"admin-org",
            "is_full_access":true
         },
         "user_profile":{
            "id":"ec04de1d-bf44-4c7d-b026-63ba730426c4",
            "created_at":"2021-08-16T08:25:57.348Z",
            "updated_at":"2021-08-16T08:25:57.348Z",
            "user_id":"faecfd39-d5bd-41c4-8924-3e59ec1de078",
            "twitter_id":"K_shir122",
            "github_id":"",
            "facebook_id":"",
            "self_introduction":""
         },
         "is_read_only":false
      }
   }
}
x86taka commented 3 years ago

原因ではありませんが、Requestのbodyにidは不要みたいです。 https://github.com/ictsc/ictsc-rikka/blob/5093fd2a35d99bf6ea96b1d416030f00a86ec260/pkg/controller/user.go#L58-L64