Commit 62d0a96a authored by Oleksii Savran's avatar Oleksii Savran Committed by Matija Obreza

Use configured services

parent ac7cce67
import axios from 'axios';
import ApiError from '../model/ApiError';
import {clearCookies} from '@genesys/client/utilities/index';
// import { refreshToken } from 'actions/login';
// todo: remove
/**
* Generate API prefix when a language is selected
* @param lang Current language ('en', 'de', ...)
*/
export const apiLanguage = (lang: string) => lang === 'en' ? '' : `/${lang}`;
axios.interceptors.response.use((response) => response, (error) => Promise.reject(ApiError.axiosError(error)));
/**
* Default Axios configuration for accessing the backend API
*/
export const axiosBackend = axios.create({
baseURL: process.env.API_URL, // use embedded proxy
timeout: 0,
withCredentials: true,
headers: {
'X-Custom-Header': 'Genesys Frontend',
'Content-Type': 'application/json',
},
});
// axiosBackend.interceptors.request.use((config) => {
// // Do something before request is sent
// console.log('Backend API request to ', config.url);
// return config;
// }, (error) => {
// console.log('Backend error!!');
// // Do something with request error
// return Promise.reject(ApiError.axiosError(error));
// });
axiosBackend.interceptors.response.use((config) =>
// Do something before request is sent
config
, (error) => {
if (axios.isCancel(error)) {
throw error;
}
console.log('Backend error!! Error', error);
if (error.response && error.response.status === 401 && error.response.data.error === 'invalid_token') {
console.log('Error on 401, invalid token: ', error);
if (typeof window !== 'undefined') {
clearCookies();
window.location.replace('/');
}
// todo maybe add window reload
// return error.config.dispatch
// ? error.config.dispatch(refreshToken())
// .then((accessToken) => {
// const extraConfig = {
// headers: {
// ...error.config.headers,
// Authorization: `Bearer ${accessToken.access_token}`,
// },
// };
//
// return axiosBackend.request({...error.config, ...extraConfig})
// .then((data) => data);
// })
// : Promise.reject(ApiError.axiosError(error));
}
// Do something with request error
return Promise.reject(error);
});
/**
* Configure axios instance used for backend API calls
* @param apiUrl baseURL to the backend API
* @param authToken OAuth authorization token
*/
export const configureBackendApi = ({apiUrl, accessToken, origin, timeout}: {apiUrl?: string, accessToken?: string, origin?: string, timeout?: number}) => {
if (apiUrl) {
console.log(`Using backend API baseURL ${apiUrl}`);
axiosBackend.defaults.baseURL = apiUrl;
console.log('axiosBackend.defaults.headers', axiosBackend.defaults.headers);
}
if (accessToken) {
console.log('Using backend API accessToken ..snip..');
axiosBackend.defaults.headers.common.Authorization = `Bearer ${accessToken}`;
}
if (origin) {
console.log(`Using origin ${origin}`);
axiosBackend.defaults.headers.common.Origin = origin;
}
if (timeout) {
console.log(`Using backend API timeout ${timeout}`);
axiosBackend.defaults.timeout = timeout;
}
};
......@@ -23,7 +23,8 @@ import { HelmetProvider } from 'react-helmet-async';
// JSS & MUI
import { MuiThemeProvider } from '@material-ui/core/styles';
import theme from 'ui/theme';
import { configureBackendApi } from '@genesys/client/utilities/requestUtils';
import { reconfigureServiceAxios } from '@genesys/client/service';
import * as cookies from 'es-cookie';
declare const __PRELOADED_STATE__: any;
......@@ -45,8 +46,14 @@ const store = composeEnhancers(applyMiddleware(thunk, routerMiddleware(history))
const SsrI18nProvider = withSSR()(I18nextProvider) as any;
const accessToken = cookies.get('access_token') || store.getState().applicationConfig.anonToken.access_token;
// Configure axios for client
configureBackendApi({ apiUrl: store.getState().applicationConfig.apiUrl || process.env.API_URL || 'http://localhost:8080' });
reconfigureServiceAxios({
apiUrl: store.getState().applicationConfig.apiUrl || process.env.API_URL || 'http://localhost:8080',
accessToken,
});
// Set date's locale for client
// moment.js uses en locale as default and don't have separate file for it so import('moment/locale/en') causes error
if (detectedLang !== 'en') {
......
import * as Loadable from 'react-loadable';
import { configureBackendApi } from '@genesys/client/utilities/requestUtils';
import { LoginService } from '@genesys/client/service/LoginService';
import { LoginService, reconfigureServiceAxios } from '@genesys/client/service';
import config from './config';
import { refreshServerStorage } from './middleware/serverStorage';
......@@ -14,12 +13,12 @@ const PORT = process.env.PORT || 3000;
const TOKEN_RETRY_PERIOD = 5 * 1000;
// Configure axios for server
configureBackendApi({ apiUrl: process.env.API_URL || config.apiUrl || 'http://localhost:8080', origin: config.origin });
reconfigureServiceAxios({ apiUrl: process.env.API_URL || config.apiUrl || 'http://localhost:8080', origin: config.origin });
const refreshAppToken = () => {
return LoginService.loginApp(config.clientId, config.clientSecret, config.apiUrl).then(async (token) => {
console.log('Received token: \n', token);
configureBackendApi({ accessToken: token.access_token });
reconfigureServiceAxios({ accessToken: token.access_token });
const refreshIn = (token.expires_in - 30) * 1000;
console.log(`Scheduling app token refresh in ${refreshIn / 1000}s`);
config.access_token = token;
......
......@@ -7,9 +7,7 @@ import languages from 'data/Languages';
// model
import ApiCall from '@genesys/client/model/ApiCall';
// service
import { CropService } from '@genesys/client/service/CropService';
import ApiInfoService from '@genesys/client/service/genesys/ApiInfoService';
import VocabularyService from '@genesys/client/service/catalog/VocabularyService';
import { VocabularyService, CropService, ApiInfoService } from '@genesys/client/service';
// server
import config from '../config';
......
......@@ -13,7 +13,7 @@ import robots from './robots';
import sitemap from './sitemap';
import { i18nServer } from '../i18n/i18n-server';
import httpProxy from './middleware/httpProxy';
import AccessionService from '@genesys/client/service/genesys/AccessionService';
import { AccessionService } from '@genesys/client/service';
import AccessionFilter from '@genesys/client/model/accession/AccessionFilter';
import geonamesHttpProxy from './middleware/geonamesHttpProxy';
const i18nextMiddleware = require('i18next-express-middleware'); // has no proper import yet
......
......@@ -7,7 +7,7 @@ import {DASHBOARD_APPEND_ACCESSIONS} from 'accessions/constants';
import {IPageRequest} from '@genesys/client/model/FilteredPage';
import AccessionFilter from '@genesys/client/model/accession/AccessionFilter';
// Service
import AccessionService from '@genesys/client/service/genesys/AccessionService';
import { AccessionService } from '@genesys/client/service';
const apiListAccessions = createApiCaller(AccessionService.list, DASHBOARD_APPEND_ACCESSIONS);
......
......@@ -24,8 +24,7 @@ import {
TOGGLE_MY_MAP,
APPEND_ACCESSIONS_WITH_IMAGES, REMOVE_MY_MAP,
} from 'accessions/constants';
import AccessionService from '@genesys/client/service/genesys/AccessionService';
import ClimateService from '@genesys/client/service/genesys/ClimateService';
import { AccessionService, ClimateService } from '@genesys/client/service';
import { showSnackbar } from 'actions/snackbar';
import Page from '@genesys/client/model/Page';
import TileClimate from '@genesys/client/model/genesys/TileClimate';
......
import { LoginService } from '@genesys/client/service/LoginService';
import { LoginService, reconfigureServiceAxios } from '@genesys/client/service';
import * as Constants from 'constants/login';
import * as cookies from 'es-cookie';
import * as jwt from 'jsonwebtoken';
......@@ -6,7 +6,6 @@ import { clearCookies, saveCookies } from '@genesys/client/utilities/';
import { ROLE_CLIENT } from 'constants/userRoles';
import {log} from '@genesys/client/utilities/debug';
import {loginUser} from 'user/actions/public';
import { configureBackendApi } from '@genesys/client/utilities/requestUtils';
export function checkAccessTokens(dispatch, getState) {
const cookieToken: string = typeof window !== 'undefined' && cookies.get('access_token');
......@@ -50,7 +49,7 @@ function loginAppRequest() {
function loginApp(d) {
// console.log('Login app', d);
configureBackendApi({ accessToken: d.access_token });
reconfigureServiceAxios({ accessToken: d.access_token });
return (dispatch, getState) => {
return dispatch({
type: Constants.LOGIN_APP,
......
......@@ -2,7 +2,7 @@ import * as _ from 'lodash';
import {SubmissionError} from 'redux-form';
import { log } from '@genesys/client/utilities/debug';
import SidPermissions from '@genesys/client/model/acl/SidPermissions';
import PermissionService from '@genesys/client/service/genesys/PermissionService';
import { PermissionService } from '@genesys/client/service';
import {createPureApiCaller} from 'actions/ApiCall';
export const permissions = (clazz: string, id: number) => (dispatch, getState) => {
......
import RepositoryFile from '@genesys/client/model/repository/RepositoryFile';
import RepositoryService from '@genesys/client/service/genesys/RepositoryService';
import { FileRepositoryService as RepositoryService } from '@genesys/client/service';
import { log } from '@genesys/client/utilities/debug';
import * as UUIDv4 from 'uuid/v4';
......
import SearchService from '@genesys/client/service/catalog/SearchService';
import DescriptorService from '@genesys/client/service/catalog/DescriptorService';
import DatasetService from '@genesys/client/service/catalog/DatasetService';
import DescriptorListService from '@genesys/client/service/catalog/DescriptorListService';
import { SearchService, DescriptorService, DatasetService, DescriptorListService } from '@genesys/client/service';
import DescriptorList from '@genesys/client/model/catalog/DescriptorList';
import Descriptor from '@genesys/client/model/catalog/Descriptor';
......
import * as Constants from 'constants/serverInfo';
import {log} from '@genesys/client/utilities/debug';
import ApiInfo from '@genesys/client/model/ApiInfo';
import ApiInfoService from '@genesys/client/service/genesys/ApiInfoService';
import AppVersionService from '@genesys/client/service/genesys/AppVersionService';
import { ApiInfoService, AppVersionService } from '@genesys/client/service';
import {showSnackbar} from 'actions/snackbar';
import PageReloadButton from 'ui/common/buttons/PageReloadButton';
......
......@@ -3,7 +3,7 @@ import {createPureApiCaller} from 'actions/ApiCall';
// Constants
// import { RECEIVE_PREVIEW, APPEND_PREVIEW_DATA } from 'amphibian/constants';
// Service
import AmphibianService from '@genesys/client/service/amphibian/AmphibianService';
import { AmphibianService } from '@genesys/client/service';
// Wrapped API calls
......
......@@ -3,7 +3,7 @@ import { showSnackbar } from 'actions/snackbar';
import {createPureApiCaller} from 'actions/ApiCall';
// service
import AdminService from '@genesys/client/service/genesys/AdminService';
import { AdminService } from '@genesys/client/service';
// Wrapped API calls
const apiReindexElasticFiltered = createPureApiCaller(AdminService.reindexElasticFiltered);
......
......@@ -19,7 +19,7 @@ import ActivityPostFilter from '@genesys/client/model/cms/ActivityPostFilter';
import Page from '@genesys/client/model/Page';
import FilteredPage, { IPageRequest } from '@genesys/client/model/FilteredPage';
// service
import CmsService from '@genesys/client/service/genesys/CmsService';
import { CmsService } from '@genesys/client/service';
// Wrapped API calls
......
......@@ -18,8 +18,7 @@ import ActivityPost from '@genesys/client/model/cms/ActivityPost';
import FilteredPage, { IPageRequest } from '@genesys/client/model/FilteredPage';
import ActivityPostFilter from '@genesys/client/model/cms/ActivityPostFilter';
// service
import CmsService from '@genesys/client/service/genesys/CmsService';
import AsciiDocService from '@genesys/client/service/genesys/AsciiDocService';
import { CmsService, AsciiDocService } from '@genesys/client/service';
import ApiCall from '@genesys/client/model/ApiCall';
// Wrapped API calls
......
import Crop from '@genesys/client/model/genesys/Crop';
import {IReducerAction} from '@genesys/client/model/common.model';
import { ADMIN_RECEIVE_CROP, UPDATE_CROPS_LIST } from 'crop/constants';
import {CropService} from '@genesys/client/service/CropService';
import navigateTo from 'actions/navigation';
import {createApiCaller, createPureApiCaller} from 'actions/ApiCall';
import {loadCrops} from './public';
import ApiCall from '@genesys/client/model/ApiCall';
import CmsService from '@genesys/client/service/genesys/CmsService';
import { CmsService, CropService } from '@genesys/client/service';
import Article from '@genesys/client/model/cms/Article';
const receiveCrop = (cropDetails: ApiCall<Crop>): IReducerAction => ({
......
import { CropService } from '@genesys/client/service/CropService';
import { CropService } from '@genesys/client/service';
import { LOAD_CROPS_CACHE_IDLE, RECEIVE_CROPS, RECEIVE_CROP_DETAILS } from 'crop/constants';
import { createApiCaller } from 'actions/ApiCall';
// Wrapped API calls
......
......@@ -21,7 +21,7 @@ import FilteredPage from '@genesys/client/model/FilteredPage';
import { AccessionRef } from '@genesys/client/model/accession/AccessionRef';
import DatasetFilter from '@genesys/client/model/catalog/DatasetFilter';
// Service
import DatasetService from '@genesys/client/service/catalog/DatasetService';
import { DatasetService } from '@genesys/client/service';
const createDataset = () => (dispatch) => {
dispatch({ type: CREATE_DATASET });
......
......@@ -26,10 +26,7 @@ import DatasetLocation from '@genesys/client/model/catalog/DatasetLocation';
import ApiCall from '@genesys/client/model/ApiCall';
// Service
import DatasetService from '@genesys/client/service/catalog/DatasetService';
import GeoService from '@genesys/client/service/genesys/GeoService';
import GeoNamesService from '@genesys/client/service/genesys/GeoNamesService';
import AccessionService from '@genesys/client/service/genesys/AccessionService';
import { DatasetService, AccessionService, GeoNamesService, GeoService } from '@genesys/client/service';
// Utility
import { log } from '@genesys/client/utilities/debug';
......
......@@ -22,7 +22,7 @@ import { AccessionRef } from '@genesys/client/model/accession/AccessionRef';
import DatasetOverview from '@genesys/client/model/catalog/DatasetOverview';
import OpResponse from '@genesys/client/model/OpResponse';
// Service
import DatasetService from '@genesys/client/service/catalog/DatasetService';
import { DatasetService } from '@genesys/client/service';
// Util
......
......@@ -20,7 +20,7 @@ import FilteredPage from '@genesys/client/model/FilteredPage';
import DescriptorListFilter from '@genesys/client/model/catalog/DescriptorListFilter';
// Service
import DescriptorListService from '@genesys/client/service/catalog/DescriptorListService';
import { DescriptorListService } from '@genesys/client/service';
// Util
import { log } from '@genesys/client/utilities/debug';
......
......@@ -14,7 +14,7 @@ import DescriptorList from '@genesys/client/model/catalog/DescriptorList';
import ApiCall from '@genesys/client/model/ApiCall';
// Service
import DescriptorListService from '@genesys/client/service/catalog/DescriptorListService';
import { DescriptorListService } from '@genesys/client/service';
// Util
import { log } from '@genesys/client/utilities/debug';
......
......@@ -24,7 +24,7 @@ import DescriptorListOverview from '@genesys/client/model/catalog/DescriptorList
import ApiCall from '@genesys/client/model/ApiCall';
// Service
import DescriptorListService from '@genesys/client/service/catalog/DescriptorListService';
import { DescriptorListService } from '@genesys/client/service';
// Util
import { log } from '@genesys/client/utilities/debug';
......
......@@ -26,7 +26,7 @@ import FilteredPage from '@genesys/client/model/FilteredPage';
import RepositoryImage from '@genesys/client/model/repository/RepositoryImage';
// Service
import DescriptorService from '@genesys/client/service/catalog/DescriptorService';
import { DescriptorService } from '@genesys/client/service';
// Create a new descriptor
export const createDescriptor = () => (dispatch) => {
......
......@@ -12,7 +12,7 @@ import Descriptor from '@genesys/client/model/catalog/Descriptor';
import ApiCall from '@genesys/client/model/ApiCall';
// Service
import DescriptorService from '@genesys/client/service/catalog/DescriptorService';
import { DescriptorService } from '@genesys/client/service';
// Util
import { log } from '@genesys/client/utilities/debug';
......
......@@ -17,7 +17,7 @@ import DescriptorFilter from '@genesys/client/model/catalog/DescriptorFilter';
import Page from '@genesys/client/model/Page';
import FilteredPage, { IPageRequest } from '@genesys/client/model/FilteredPage';
// Service
import DescriptorService from '@genesys/client/service/catalog/DescriptorService';
import { DescriptorService } from '@genesys/client/service';
// Util
import { log } from '@genesys/client/utilities/debug';
......
......@@ -19,7 +19,7 @@ import { createApiCaller } from 'actions/ApiCall';
import { filterCodeToUrl } from 'actions/filterCode';
import { apiApproveDiversityTrees, apiDeleteDiversityTrees, apiRejectDiversityTrees } from 'divtree/actions/editor';
import DiversityTreeService from '@genesys/client/service/genesys/DiversityTreeService';
import { DiversityTreeService } from '@genesys/client/service';
import DiversityTreeAccessionRef from '@genesys/client/model/DiversityTreeAccessionRef';
export const receiveDivTree = (apiCall: ApiCall<DiversityTree>) => ({
......
......@@ -21,8 +21,7 @@ import DiversityTreeAccessionRef from '@genesys/client/model/DiversityTreeAccess
import DiversityTreeCreator, { CreatorRole } from '@genesys/client/model/DiversityTreeCreator';
// Service
import AccessionService from '@genesys/client/service/genesys/AccessionService';
import DiversityTreeService from '@genesys/client/service/genesys/DiversityTreeService';
import { AccessionService, DiversityTreeService } from '@genesys/client/service';
// UI
import steps from 'divtree/ui/dashboard/diversity-tree-stepper/steps';
......
......@@ -17,8 +17,7 @@ import {
} from 'divtree/constants';
// Service
import AccessionService from '@genesys/client/service/genesys/AccessionService';
import DiversityTreeService from '@genesys/client/service/genesys/DiversityTreeService';
import { AccessionService, DiversityTreeService } from '@genesys/client/service';
// Model
import FilteredPage from '@genesys/client/model/FilteredPage';
......
import {createApiCaller, createPureApiCaller} from 'actions/ApiCall';
import GeoService from '@genesys/client/service/genesys/GeoService';
import { GeoService, VocabularyService } from '@genesys/client/service';
import {RECEIVE_COUNTRIES, RECEIVE_COUNTRY_CODES_DECODED, RECEIVE_COUNTRY_DETAILS, RECEIVE_REGION_DETAILS, RECEIVE_REGIONS} from 'geo/constants';
import VocabularyService from '@genesys/client/service/catalog/VocabularyService';
// Wrapped API Calls
const apiListCountries = createApiCaller(GeoService.listCountries, RECEIVE_COUNTRIES);
......
......@@ -7,8 +7,7 @@ import {DASHBOARD_APPEND_INSTITUTES, DASHBOARD_RECEIVE_INSTITUTE, DASHBOARD_RECE
import {IPageRequest} from '@genesys/client/model/FilteredPage';
import FaoInstitute from '@genesys/client/model/genesys/FaoInstitute';
// service
import InstituteService from '@genesys/client/service/genesys/InstituteService';
import CmsService from '@genesys/client/service/genesys/CmsService';
import { InstituteService, CmsService } from '@genesys/client/service';
import Article from '@genesys/client/model/cms/Article';
// Wrapped API Calls
......
......@@ -6,7 +6,7 @@ import {APPEND_INSTITUTES, RECEIVE_INSTITUTE} from 'institutes/constants';
import FaoInstitute from '@genesys/client/model/genesys/FaoInstitute';
import FaoInstituteFilter from '@genesys/client/model/genesys/FaoInstituteFilter';
import FilteredPage, {IPageRequest} from '@genesys/client/model/FilteredPage';
import InstituteService from '@genesys/client/service/genesys/InstituteService';
import { InstituteService } from '@genesys/client/service';
import { showSnackbar } from 'actions/snackbar';
import Page from '@genesys/client/model/Page';
import {filterCodeToUrl} from 'actions/filterCode';
......
......@@ -25,7 +25,7 @@ import Execution from '@genesys/client/model/kpi/Execution';
import ApiCall from '@genesys/client/model/ApiCall';
// service
import KpiService from '@genesys/client/service/genesys/KpiService';
import { KpiService } from '@genesys/client/service';
// Wrapped API calls
......
import {createApiCaller, createPureApiCaller} from 'actions/ApiCall';
import KpiService from '@genesys/client/service/genesys/KpiService';
import { KpiService } from '@genesys/client/service';
import {DASHBOARD_RECEIVE_OBSERVATIONS} from 'kpi/constants';
import {IPageRequest} from '@genesys/client/model/Page';
......
......@@ -9,12 +9,10 @@ import {
} from 'list/constants';
import {createPureApiCaller} from 'actions/ApiCall';
import { showSnackbar } from 'actions/snackbar';
import AccessionService from '@genesys/client/service/genesys/AccessionService';
import SubsetService from '@genesys/client/service/genesys/SubsetService';
import { AccessionService, SubsetService, DatasetService } from '@genesys/client/service';
import Page, {IPageRequest, SortDirection} from '@genesys/client/model/Page';
import Subset from '@genesys/client/model/subset/Subset';
import Dataset from '@genesys/client/model/catalog/Dataset';
import DatasetService from '@genesys/client/service/catalog/DatasetService';
import { listAccessionsByUuid } from 'accessions/actions/public';
import Accession from '@genesys/client/model/accession/Accession';
import ApiCall from '@genesys/client/model/ApiCall';
......
......@@ -5,7 +5,7 @@ import {
REMOVE_NETWORK,
} from 'networks/constants';
// service
import NetworkService from '@genesys/client/service/genesys/NetworkService';
import { NetworkService } from '@genesys/client/service';
import PGRFANetwork from '@genesys/client/model/network/PGRFANetwork';
export const deleteNetwork = (network: PGRFANetwork) => (dispatch, getState) => {
......
......@@ -15,7 +15,7 @@ import PGRFANetwork from '@genesys/client/model/network/PGRFANetwork';
import ApiCall from '@genesys/client/model/ApiCall';
// Service
import NetworkService from '@genesys/client/service/genesys/NetworkService';
import { NetworkService } from '@genesys/client/service';
// Util
import { log } from '@genesys/client/utilities/debug';
......
......@@ -5,7 +5,7 @@ import ApiCall from '@genesys/client/model/ApiCall';
// constants
import {APPEND_NETWORK_PAGE, RECEIVE_NETWORK_DETAILS, RECEIVE_NETWORK_INSTITUTES, RESET_NETWORK_DETAILS, RESET_NETWORK_INSTITUTES} from 'networks/constants';
// service
import NetworkService from '@genesys/client/service/genesys/NetworkService';
import { NetworkService } from '@genesys/client/service';
import {IPageRequest} from '@genesys/client/model/Page';
......
......@@ -15,7 +15,7 @@ import Page from '@genesys/client/model/Page';
import Partner from '@genesys/client/model/genesys/Partner';
// Service
import PartnerService from '@genesys/client/service/catalog/PartnerService';
import { PartnerService } from '@genesys/client/service';
// Util
import { log } from '@genesys/client/utilities/debug';
......
......@@ -15,7 +15,7 @@ import { IReducerAction } from '@genesys/client/model/common.model';
import ApiCall from '@genesys/client/model/ApiCall';
// Service
import PartnerService from '@genesys/client/service/catalog/PartnerService';
import { PartnerService } from '@genesys/client/service';
// Util
import { log } from '@genesys/client/utilities/debug';
......
......@@ -24,7 +24,7 @@ import ApiCall from '@genesys/client/model/ApiCall';
import FaoInstitute from '@genesys/client/model/genesys/FaoInstitute';
// Service
import PartnerService from '@genesys/client/service/catalog/PartnerService';
import { PartnerService } from '@genesys/client/service';
// Util
import { log } from '@genesys/client/utilities/debug';
......
......@@ -20,7 +20,7 @@ import {
import { IReducerAction } from '@genesys/client/model/common.model';
// Service
import RepositoryService from '@genesys/client/service/genesys/RepositoryService';
import { FileRepositoryService as RepositoryService } from '@genesys/client/service';
// Util
import {log} from '@genesys/client/utilities/debug';
......
......@@ -21,8 +21,7 @@ import {filterCodeToUrl} from 'actions/filterCode';
import { showSnackbar } from 'actions/snackbar';
// services
import RequestService from '@genesys/client/service/genesys/RequestService';
import AccessionService from '@genesys/client/service/genesys/AccessionService';
import { RequestService, AccessionService } from '@genesys/client/service';
// models
import MaterialRequest from '@genesys/client/model/request/MaterialRequest';
......
import RequestService from '@genesys/client/service/genesys/RequestService';
import { RequestService } from '@genesys/client/service';
import {RECEIVE_REQUEST_INFO} from 'requests/constants';