Skip to content

Commit

Permalink
Merge pull request #308 from yuminn-k/feat/extend-getclass-response
Browse files Browse the repository at this point in the history
[MIN-300] クラス情報取得の際にクラスコードとシークレットを含める修正
  • Loading branch information
yuminn-k authored Jun 12, 2024
2 parents a2e5750 + 434bb3a commit 856549a
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions controllers/class_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,22 @@ func (cc *ClassController) GetClass(ctx *gin.Context) {
}

log.Printf("Retrieved class: %+v with class code: %+v", class, classCode)

response := gin.H{
"class": class,
}
var response gin.H
if classCode != nil {
response["code"] = classCode.Code
if classCode.Secret != nil {
response["secret"] = *classCode.Secret
response = gin.H{
"class": class,
"code": classCode.Code,
"secret": *classCode.Secret,
}
}
response = gin.H{
"class": class,
"code": classCode.Code,
}
}
response = gin.H{
"class": class,
}

respondWithSuccess(ctx, constants.StatusOK, response)
Expand Down

0 comments on commit 856549a

Please sign in to comment.