From 41f8b1daddbf581083153eb32bbb24581c08784e Mon Sep 17 00:00:00 2001 From: Thitiphum Chaikarnjanakit Date: Sun, 12 May 2024 10:52:51 +0700 Subject: [PATCH] fix conflict transaction --- api/api.go | 1 + api/transaction/transaction.go | 1 + api/transaction/transaction_test.go | 1 + 3 files changed, 3 insertions(+) diff --git a/api/api.go b/api/api.go index 6ef683f..47bec2e 100644 --- a/api/api.go +++ b/api/api.go @@ -33,6 +33,7 @@ func New(db *sql.DB, cfg config.Config, logger *zap.Logger) *Server { v1.GET("/slow", health.Slow) v1.GET("/health", health.Check(db)) v1.POST("/upload", eslip.Upload) + // For pre-commit v1.GET("/transactions", transaction.GetTransactionsHandler(db)) { diff --git a/api/transaction/transaction.go b/api/transaction/transaction.go index 9e788bc..24af490 100644 --- a/api/transaction/transaction.go +++ b/api/transaction/transaction.go @@ -56,6 +56,7 @@ type TransactionReqBody struct { Note string `json:"note"` ImageURL string `json:"image_url"` } +// For pre-commit // GetTransactionsHandler returns a handler function to fetch transactions with optional pagination and filtering. func GetTransactionsHandler(db *sql.DB) echo.HandlerFunc { return func(c echo.Context) error { diff --git a/api/transaction/transaction_test.go b/api/transaction/transaction_test.go index ea62d0c..d3234a9 100644 --- a/api/transaction/transaction_test.go +++ b/api/transaction/transaction_test.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/assert" ) +// For pre-commit func TestGetTransactionsHandler(t *testing.T) { // Create a new instance of Echo e := echo.New()