class Graphql::Dashboard::OperationStore::ClientsController
Public Instance Methods
Source
# File lib/graphql/dashboard/operation_store.rb, line 41 def create client_params = params.require(:client).permit(:name, :secret) schema_class.operation_store.upsert_client(client_params[:name], client_params[:secret]) flash[:success] = "Created #{client_params[:name].inspect}" redirect_to graphql_dashboard.operation_store_clients_path end
Source
# File lib/graphql/dashboard/operation_store.rb, line 60 def destroy client_name = params[:name] schema_class.operation_store.delete_client(client_name) flash[:success] = "Deleted #{client_name.inspect}" redirect_to graphql_dashboard.operation_store_clients_path end
Source
# File lib/graphql/dashboard/operation_store.rb, line 48 def edit @client = schema_class.operation_store.get_client(params[:name]) end
Source
# File lib/graphql/dashboard/operation_store.rb, line 24 def index @order_by = params[:order_by] || "name" @order_dir = params[:order_dir].presence || "asc" clients_page = schema_class.operation_store.all_clients( page: params[:page]&.to_i || 1, per_page: params[:per_page]&.to_i || 25, order_by: @order_by, order_dir: @order_dir, ) @clients_page = clients_page end
Source
# File lib/graphql/dashboard/operation_store.rb, line 37 def new @client = init_client(secret: SecureRandom.hex(32)) end
Source
# File lib/graphql/dashboard/operation_store.rb, line 52 def update client_name = params[:name] client_secret = params.require(:client).permit(:secret)[:secret] schema_class.operation_store.upsert_client(client_name, client_secret) flash[:success] = "Updated #{client_name.inspect}" redirect_to graphql_dashboard.operation_store_clients_path end