-feat 修复部分bug
This commit is contained in:
@@ -5,9 +5,9 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"accounting-app/pkg/api"
|
||||
"accounting-app/internal/models"
|
||||
"accounting-app/internal/service"
|
||||
"accounting-app/pkg/api"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
@@ -155,6 +155,17 @@ func (h *TransactionHandler) GetTransactions(c *gin.Context) {
|
||||
input.AccountID = &accID
|
||||
}
|
||||
|
||||
// Parse ledger filter
|
||||
if ledgerIDStr := c.Query("ledger_id"); ledgerIDStr != "" {
|
||||
ledgerID, err := strconv.ParseUint(ledgerIDStr, 10, 32)
|
||||
if err != nil {
|
||||
api.BadRequest(c, "Invalid ledger_id")
|
||||
return
|
||||
}
|
||||
lid := uint(ledgerID)
|
||||
input.LedgerID = &lid
|
||||
}
|
||||
|
||||
if typeStr := c.Query("type"); typeStr != "" {
|
||||
txnType := models.TransactionType(typeStr)
|
||||
input.Type = &txnType
|
||||
|
||||
Reference in New Issue
Block a user