FIX: remove unneeded keys from failed response

FIX: remove unneeded keys from failed response

From 60941f214cf82d8da9ade63e1f632d062526ac82 Mon Sep 17 00:00:00 2001
From: Arpit Jalan <arpit@techapj.com>
Date: Thu, 22 Nov 2018 14:59:50 +0530
Subject: [PATCH] FIX: remove unneeded keys from failed response


diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index e6964ed..1f21601 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -545,11 +545,8 @@ class UsersController < ApplicationController
         else
           if @error || @user&.errors&.any?
             render json: {
-              success: false,
               message: @error,
-              errors: @user&.errors&.to_hash,
-              is_developer: UsernameCheckerService.is_developer?(@user&.email),
-              admin: @user&.admin?
+              errors: @user&.errors&.to_hash
             }
           else
             render json: {

GitHub

1 Like