diff --git a/src/components/POLine/POLine.js b/src/components/POLine/POLine.js index 78935d4a6..0453f308e 100644 --- a/src/components/POLine/POLine.js +++ b/src/components/POLine/POLine.js @@ -1,7 +1,6 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { get } from 'lodash'; - import { IfPermission } from '@folio/stripes/core'; import { Accordion, @@ -14,12 +13,7 @@ import { PaneMenu, Row, } from '@folio/stripes/components'; - import transitionToParams from '../Utils/transitionToParams'; -import { - LINES_API, - ORDER_DETAIL_API, -} from '../Utils/api'; import { POLineDetails } from './POLineDetails'; import CostView from './Cost/CostView'; import TagView from './Tags/TagView'; @@ -42,12 +36,12 @@ class POLine extends Component { static manifest = Object.freeze({ order: { type: 'okapi', - path: ORDER_DETAIL_API, + path: 'orders/:{id}', throwErrors: false, }, poLine: { type: 'okapi', - path: LINES_API, + path: 'orders/:{id}/lines', fetch: false, }, }); diff --git a/src/components/PurchaseOrder/PO.js b/src/components/PurchaseOrder/PO.js index 811344de8..f35e248ae 100644 --- a/src/components/PurchaseOrder/PO.js +++ b/src/components/PurchaseOrder/PO.js @@ -21,10 +21,6 @@ import { LayerPO, LayerPOLine, } from '../LayerCollection'; -import { - LINES_API, - ORDER_DETAIL_API, -} from '../Utils/api'; import transitionToParams from '../Utils/transitionToParams'; import { updateOrderResource } from '../Utils/orderResource'; import { MODULE_ORDERS } from '../Utils/const'; @@ -38,11 +34,11 @@ class PO extends Component { static manifest = Object.freeze({ order: { type: 'okapi', - path: ORDER_DETAIL_API, + path: 'orders/:{id}', }, poLine: { type: 'okapi', - path: LINES_API, + path: 'orders/:{id}/lines', fetch: false, throwErrors: false, }, diff --git a/src/components/Utils/api.js b/src/components/Utils/api.js deleted file mode 100644 index c36377a75..000000000 --- a/src/components/Utils/api.js +++ /dev/null @@ -1,3 +0,0 @@ -export const ORDERS_API = 'orders/composite-orders'; -export const ORDER_DETAIL_API = `${ORDERS_API}/:{id}`; -export const LINES_API = 'orders/order-lines'; diff --git a/src/routes/Main.js b/src/routes/Main.js index 65662f881..e897f3415 100644 --- a/src/routes/Main.js +++ b/src/routes/Main.js @@ -16,7 +16,6 @@ import { POForm } from '../components/PurchaseOrder'; import { Filters, SearchableIndexes } from '../components/Utils/FilterConfig'; import FolioFormattedTime from '../components/FolioFormattedTime'; import { createOrderResource } from '../components/Utils/orderResource'; -import { ORDERS_API } from '../components/Utils/api'; const INITIAL_RESULT_COUNT = 30; const RESULT_COUNT_INCREMENT = 30; @@ -36,7 +35,7 @@ class Main extends Component { resultCount: { initialValue: INITIAL_RESULT_COUNT }, records: { type: 'okapi', - path: ORDERS_API, + path: 'orders', records: 'purchase_orders', recordsRequired: '%{resultCount}', perRequest: RESULT_COUNT_INCREMENT, diff --git a/test/bigtest/network/config.js b/test/bigtest/network/config.js index 809a866b2..0a19e43cc 100644 --- a/test/bigtest/network/config.js +++ b/test/bigtest/network/config.js @@ -1,15 +1,9 @@ // typical mirage config export // http://www.ember-cli-mirage.com/docs/v0.4.x/configuration/ -import { - ORDERS_API, -} from '../../../src/components/Utils/api'; - export default function config() { - this.get(ORDERS_API, (schema, request) => { - return schema.orders.all(); - }); + this.get('/orders'); - this.get(`${ORDERS_API}/:id`, (schema, request) => { + this.get('/orders/:id', (schema, request) => { return schema.orders.find(request.params.id).attrs; });