Skip to content

Commit

Permalink
fix conflict transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
thitiphum-bluesage committed May 12, 2024
1 parent e52dfd7 commit 41f8b1d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))

{
Expand Down
1 change: 1 addition & 0 deletions api/transaction/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions api/transaction/transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 41f8b1d

Please sign in to comment.