DEV: Render a proper response that can be handled on the client side.

DEV: Render a proper response that can be handled on the client side.

diff --git a/app/controllers/invites_controller.rb b/app/controllers/invites_controller.rb
index ed5b6a0..c429fe3 100644
--- a/app/controllers/invites_controller.rb
+++ b/app/controllers/invites_controller.rb
@@ -165,14 +165,14 @@ class InvitesController < ApplicationController
     raise Discourse::InvalidParameters.new(:id) if invite.blank?
     invite.trash!(current_user)
 
-    render body: nil
+    render json: success_json
   end
 
   def rescind_all_invites
     guardian.ensure_can_rescind_all_invites!(current_user)
 
     Invite.rescind_all_expired_invites_from(current_user)
-    render body: nil
+    render json: success_json
   end
 
   def resend_invite
@@ -182,7 +182,7 @@ class InvitesController < ApplicationController
     invite = Invite.find_by(invited_by_id: current_user.id, email: params[:email])
     raise Discourse::InvalidParameters.new(:email) if invite.blank?
     invite.resend_invite
-    render body: nil
+    render json: success_json
 
   rescue RateLimiter::LimitExceeded
     render_json_error(I18n.t("rate_limiter.slow_down"))
@@ -192,7 +192,7 @@ class InvitesController < ApplicationController
     guardian.ensure_can_resend_all_invites!(current_user)
 
     Invite.resend_all_invites_from(current_user.id)
-    render body: nil
+    render json: success_json
   end
 
   def upload_csv
diff --git a/spec/requests/invites_controller_spec.rb b/spec/requests/invites_controller_spec.rb
index 3ba6d09..2a5752d 100644
--- a/spec/requests/invites_controller_spec.rb
+++ b/spec/requests/invites_controller_spec.rb
@@ -70,6 +70,9 @@ describe InvitesController do
 
       it "destroys the invite" do
         delete "/invites.json", params: { id: invite.id }
+
+        expect(response.status).to eq(200)
+
         invite.reload
         expect(invite.trashed?).to be_truthy
       end

GitHub sha: 45fd668d