🚧 working on get questions endpoint
Co-authored-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
parent
87a2914573
commit
191404a9ee
3 changed files with 71 additions and 7 deletions
|
@ -13,7 +13,7 @@ import (
|
|||
type FormData struct {
|
||||
Age string `json:"age"`
|
||||
Education string `json:"education"`
|
||||
HealthcarePersonnel bool `json:"healthcare_personnel"`
|
||||
HealthcarePersonnel bool `json:"healthcare_personnel"`
|
||||
Gender string `json:"gender"`
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ func main() {
|
|||
}
|
||||
|
||||
// Capture both the ID and error returned from InsertData
|
||||
respondentId, err := db.InsertData(requestBody.Age, requestBody.Education, requestBody.HealthcarePersonnel, requestBody.Gender)
|
||||
respondentId, err := db.InsertUserData(requestBody.Age, requestBody.Education, requestBody.HealthcarePersonnel, requestBody.Gender)
|
||||
|
||||
if err != nil {
|
||||
fmt.Print(err)
|
||||
|
@ -39,6 +39,8 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Respond with the ID of the newly inserted respondent
|
||||
c.JSON(http.StatusOK, gin.H{"respondentID": respondentId})
|
||||
})
|
||||
|
|
Reference in a new issue