Created
June 21, 2018 16:00
-
-
Save mohashari/252d8602f79ebcd6a22d84cd7b4ae0c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func cretedStudent(c *gin.Context) { | |
| var std transformedStudent | |
| var model student | |
| c.Bind(&std) | |
| validasi := validatorCreated(std) | |
| model = transferVoToModel(std) | |
| if validasi != "" { | |
| c.JSON(http.StatusOK, gin.H{"message": http.StatusOK, "result": validasi}) | |
| } else { | |
| db.Create(&model) | |
| c.JSON(http.StatusOK, gin.H{"message": http.StatusOK, "result": model}) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment