Skip to content

Commit

Permalink
add condition to deletion (#1465)
Browse files Browse the repository at this point in the history
  • Loading branch information
charymalloju authored Nov 12, 2024
2 parents ae90850 + 2e5efbb commit a961975
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions server/handler/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -551,7 +546,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",
Expand Down

0 comments on commit a961975

Please sign in to comment.