fix: align inbox project routes
This commit is contained in:
@@ -17,7 +17,7 @@ func NewHandler(service *Service) *Handler {
|
||||
}
|
||||
|
||||
func (h *Handler) Register(router gin.IRouter) {
|
||||
router.POST("/projects/:projectID/inbox", h.capture)
|
||||
router.POST("/projects/:id/inbox", h.capture)
|
||||
router.POST("/inbox/:id/analyze", h.analyze)
|
||||
router.POST("/inbox/:id/confirm", h.confirm)
|
||||
}
|
||||
@@ -28,7 +28,7 @@ func (h *Handler) capture(c *gin.Context) {
|
||||
c.JSON(http.StatusUnauthorized, gin.H{"error": "missing current user"})
|
||||
return
|
||||
}
|
||||
projectID, err := strconv.ParseUint(c.Param("projectID"), 10, 64)
|
||||
projectID, err := strconv.ParseUint(c.Param("id"), 10, 64)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid project id"})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user