🚧 working on submitting form
Co-authored-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
		
							parent
							
								
									e3a6ff55b4
								
							
						
					
					
						commit
						6a3f5cf825
					
				
					 4 changed files with 42 additions and 6 deletions
				
			
		|  | @ -23,7 +23,7 @@ func main() { | |||
|     router.Use(cors.Default()) | ||||
|      | ||||
|     // Info about user | ||||
|     router.POST("/submitform", func(c *gin.Context) { | ||||
|     router.POST("/submituserform", func(c *gin.Context) { | ||||
| 
 | ||||
|         var requestBody FormData | ||||
| 
 | ||||
|  | @ -65,6 +65,14 @@ func main() { | |||
|         c.JSON(http.StatusOK, gin.H{"questions": questions}) | ||||
|     }) | ||||
| 
 | ||||
|     router.POST("/submitanswers", func(c *gin.Context) { | ||||
|         var requestBody FormData | ||||
| 
 | ||||
|         if err := c.BindJSON(&requestBody); err != nil { | ||||
|             fmt.Print(err) | ||||
|         } | ||||
|     }) | ||||
| 
 | ||||
|     // Run the server on port 8080 | ||||
|     router.Run(":8080") | ||||
|     //db.SetupDb() | ||||
|  |  | |||
		Reference in a new issue
	
	 haraldnilsen
						haraldnilsen