How to use the conf/local.js.apiURL function in conf

To help you get started, we’ve selected a few conf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github First-Peoples-Cultural-Council / fv-web-ui / frontend / app / assets / javascripts / providers / redux / reducers / rest / actions.js View on Github external
return (dispatch) => {
      dispatch({
        type: key + '_QUERY_START',
        pathOrId: pathOrId,
        message:
          IntlService.instance.searchAndReplace(messageStart) ||
          IntlService.instance.translate({
            key: 'providers.fetch_started',
            default: 'Fetch Started',
            case: 'words',
          }) + '...',
      })

      // Switch methods used based on path until everything is converted to use the the new endpoints
      if (pathOrId.indexOf(ConfGlobal.apiURL) !== -1) {
        return DirectoryOperations.getDocumentsViaAPI(pathOrId)
          .then((response) => {
            dispatch({
              type: key + '_QUERY_SUCCESS',
              message: _messageSuccess,
              response: response,
              pathOrId: pathOrId,
            })
          })
          .catch((error) => {
            dispatch({
              type: key + '_QUERY_ERROR',
              message: _messageError || IntlService.instance.searchAndReplace(error),
              pathOrId: pathOrId,
            })
          })
github First-Peoples-Cultural-Council / fv-web-ui / frontend / app / assets / javascripts / providers / restActions.js View on Github external
return (dispatch) => {
        dispatch({
          type: key + '_QUERY_START',
          pathOrId: pathOrId,
          message:
            _messageStart ||
            IntlService.instance.translate({
              key: 'providers.fetch_started',
              default: 'Fetch Started',
              case: 'words',
            }) + '...',
        })

        // Switch methods used based on path until everything is converted to use the the new endpoints
        if (pathOrId.indexOf(ConfGlobal.apiURL) !== -1) {
          return DirectoryOperations.getDocumentsViaAPI(pathOrId)
            .then((response) => {
              dispatch({
                type: key + '_QUERY_SUCCESS',
                message: _messageSuccess,
                response: response,
                pathOrId: pathOrId,
              })
            })
            .catch((error) => {
              dispatch({
                type: key + '_QUERY_ERROR',
                message: _messageError || IntlService.instance.searchAndReplace(error),
                pathOrId: pathOrId,
              })
            })
github First-Peoples-Cultural-Council / fv-web-ui / frontend / app / assets / javascripts / providers / rest-actions.js View on Github external
return (dispatch) => {
        dispatch({
          type: key + '_QUERY_START',
          pathOrId: pathOrId,
          message:
            messageStart ||
            IntlService.instance.translate({
              key: 'providers.fetch_started',
              default: 'Fetch Started',
              case: 'words',
            }) + '...',
        })

        // Switch methods used based on path until everything is converted to use the the new endpoints
        if (pathOrId.indexOf(ConfGlobal.apiURL) !== -1) {
          return DirectoryOperations.getDocumentsViaAPI(pathOrId)
            .then((response) => {
              dispatch({
                type: key + '_QUERY_SUCCESS',
                message: messageSuccess,
                response: response,
                pathOrId: pathOrId,
              })
            })
            .catch((error) => {
              dispatch({
                type: key + '_QUERY_ERROR',
                message: messageError || IntlService.instance.searchAndReplace(error),
                pathOrId: pathOrId,
              })
            })