From 4e98fc0d8ef5db922b60bdf5caba4bd65dcd2a52 Mon Sep 17 00:00:00 2001 From: charymalloju Date: Tue, 12 Nov 2024 11:48:22 +0530 Subject: [PATCH 1/2] add condition to deletion --- server/handler/transactions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/handler/transactions.go b/server/handler/transactions.go index 92ce74ec5..3e0f1a328 100644 --- a/server/handler/transactions.go +++ b/server/handler/transactions.go @@ -551,7 +551,7 @@ func (h *Handler) DeleteTransaction(c echo.Context) error { // Clear signatures for transactions with signed_at > txSignedAt if !signedAt.IsZero() { - _, err = h.DB.Exec(`UPDATE transactions SET signatures='[]'::jsonb WHERE multisig_address=$1 AND signed_at > $2`, address, signedAt) + _, err = h.DB.Exec(`UPDATE transactions SET signatures='[]'::jsonb WHERE multisig_address=$1 AND signed_at > $2 and status='PENDING'`, address, signedAt) if err != nil { return c.JSON(http.StatusInternalServerError, model.ErrorResponse{ Status: "error", From 2e5efbb2a9b89fe1f98b5e4416de9cf991efe2d0 Mon Sep 17 00:00:00 2001 From: charymalloju Date: Tue, 12 Nov 2024 11:51:22 +0530 Subject: [PATCH 2/2] remove condition for deletion --- server/handler/transactions.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/server/handler/transactions.go b/server/handler/transactions.go index 3e0f1a328..0663b5561 100644 --- a/server/handler/transactions.go +++ b/server/handler/transactions.go @@ -532,11 +532,6 @@ func (h *Handler) DeleteTransaction(c echo.Context) error { Message: "transaction not found", }) } - return c.JSON(http.StatusInternalServerError, model.ErrorResponse{ - Status: "error", - Message: "failed to fetch transaction details", - Log: err.Error(), - }) } // Delete the transaction