fix: align inbox project routes

This commit is contained in:
2026-07-20 22:35:45 +08:00
parent c1a144cb44
commit 54958382f1
5 changed files with 93 additions and 11 deletions

View File

@@ -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