Refactor admin donation pages, fix errors
All checks were successful
continuous-integration/drone/push Build is passing

Not sending the right response codes for Turbo to handle.
This commit is contained in:
Râu Cao
2023-03-15 15:24:00 +07:00
parent 95fac38b53
commit f050d010fd
7 changed files with 23 additions and 20 deletions

View File

@@ -41,7 +41,7 @@ class Admin::DonationsController < Admin::BaseController
end
format.json { render :show, status: :created, location: @donation }
else
format.html { render :new }
format.html { render :new, status: :unprocessable_entity }
format.json { render json: @donation.errors, status: :unprocessable_entity }
end
end
@@ -59,7 +59,7 @@ class Admin::DonationsController < Admin::BaseController
end
format.json { render :show, status: :ok, location: @donation }
else
format.html { render :edit }
format.html { render :edit, status: :unprocessable_entity }
format.json { render json: @donation.errors, status: :unprocessable_entity }
end
end