Repository: hasura/graphql-engine
File: console/src/components/Services/Data/Function/customFunctionReducer.js (JavaScript)

Code before:

import { showSuccessNotification } from '../../Common/Notification';

import { fetchTrackedFunctions } from '../DataActions';

import _push from '../push';
import { getSchemaBaseRoute } from '../../../Common/utils/routesUtils';
import { getRunSqlQuery } from '../../../Common/utils/v1QueryUtils';

/* Constants */

const RESET = '@customFunction/RESET';
const FETCHING_INDIV_CUSTOM_FUNCTION =
  '@customFunction/FETCHING_INDIV_CUSTOM_FUNCTION';
const CUSTOM_FUNCTION_FETCH_SUCCESS =
  '@customFunction/CUSTOM_FUNCTION_FETCH_SUCCESS';
const CUSTOM_FUNCTION_FETCH_FAIL = '@customFunction/CUSTOM_FUNCTION_FETCH_FAIL';
const DELETING_CUSTOM_FUNCTION = '@customFunction/DELETING_CUSTOM_FUNCTION';
const DELETE_CUSTOM_FUNCTION_FAIL =
  '@customFunction/DELETE_CUSTOM_FUNCTION_FAIL';

const UNTRACKING_CUSTOM_FUNCTION = '@customFunction/UNTRACKING_CUSTOM_FUNCTION';
const UNTRACK_CUSTOM_FUNCTION_FAIL =
  '@customFunction/UNTRACK_CUSTOM_FUNCTION_FAIL';

const SESSVAR_CUSTOM_FUNCTION_ADDING =
  '@customFunction/SESSVAR_CUSTOM_FUNCTION_ADDING';
const SESSVAR_CUSTOM_FUNCTION_ADD_FAIL =
  '@customFunction/SESSVAR_CUSTOM_FUNCTION_ADD_FAIL';
const SESSVAR_CUSTOM_FUNCTION_ADD_SUCCESS =
  '@customFunction/SESSVAR_CUSTOM_FUNCTION_ADD_SUCCESS';

/* */

const makeRequest = (
  upQueries,
  downQueries,
  migrationName,
  customOnSuccess,
  customOnError,
  requestMsg,
  successMsg,
  errorMsg
) => {
  return (dispatch, getState) => {
    const upQuery = {
      type: 'bulk',
      args: upQueries,
    };

    const downQuery = {

Review comment (suggestion):
```suggestion
const SESSVAR_CUSTOM_FUNCTION_REQUEST =
```

Code after:

import { showSuccessNotification } from '../../Common/Notification';

import { fetchTrackedFunctions } from '../DataActions';

import _push from '../push';
import { getSchemaBaseRoute } from '../../../Common/utils/routesUtils';
import { getRunSqlQuery } from '../../../Common/utils/v1QueryUtils';

/* Constants */

const RESET = '@customFunction/RESET';
const FETCHING_INDIV_CUSTOM_FUNCTION =
  '@customFunction/FETCHING_INDIV_CUSTOM_FUNCTION';
const CUSTOM_FUNCTION_FETCH_SUCCESS =
  '@customFunction/CUSTOM_FUNCTION_FETCH_SUCCESS';
const CUSTOM_FUNCTION_FETCH_FAIL = '@customFunction/CUSTOM_FUNCTION_FETCH_FAIL';
const DELETING_CUSTOM_FUNCTION = '@customFunction/DELETING_CUSTOM_FUNCTION';
const DELETE_CUSTOM_FUNCTION_FAIL =
  '@customFunction/DELETE_CUSTOM_FUNCTION_FAIL';

const UNTRACKING_CUSTOM_FUNCTION = '@customFunction/UNTRACKING_CUSTOM_FUNCTION';
const UNTRACK_CUSTOM_FUNCTION_FAIL =
  '@customFunction/UNTRACK_CUSTOM_FUNCTION_FAIL';

const SESSVAR_CUSTOM_FUNCTION_REQUEST =
  '@customFunction/SESSVAR_CUSTOM_FUNCTION_REQUEST';
const SESSVAR_CUSTOM_FUNCTION_ADD_FAIL =
  '@customFunction/SESSVAR_CUSTOM_FUNCTION_ADD_FAIL';
const SESSVAR_CUSTOM_FUNCTION_ADD_SUCCESS =
  '@customFunction/SESSVAR_CUSTOM_FUNCTION_ADD_SUCCESS';

/* */

const makeRequest = (
  upQueries,
  downQueries,
  migrationName,
  customOnSuccess,
  customOnError,
  requestMsg,
  successMsg,
  errorMsg
) => {
  return (dispatch, getState) => {
    const upQuery = {
      type: 'bulk',
      args: upQueries,
    };

    const downQuery = {