Implement API endpoint for transactions

This commit is contained in:
2022-01-25 19:17:48 +00:00
parent 458f4f0e8f
commit c2bbaebfd2
4 changed files with 33 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package http
import (
"fmt"
"net/http"
"git.javil.eu/jacob1123/budgeteer/postgres"
@ -17,8 +18,7 @@ func (h *Handler) getImportantData(c *gin.Context) {
budgetID := c.Param("budgetid")
budgetUUID, err := uuid.Parse(budgetID)
if err != nil {
c.Redirect(http.StatusTemporaryRedirect, "/login")
c.Abort()
c.AbortWithError(http.StatusBadRequest, fmt.Errorf("budgetid missing from URL"))
return
}