Skip to content

Commit

Permalink
Merge pull request #161 from folio-org/revert-159-UIOR-97-change-api-…
Browse files Browse the repository at this point in the history
…endpoints

Revert "UIOR-97 change API enpoints"
  • Loading branch information
aliaksei-chumakou authored Jan 15, 2019
2 parents 8e4fe27 + 3723863 commit a171e6c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 27 deletions.
10 changes: 2 additions & 8 deletions src/components/POLine/POLine.js
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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';
Expand All @@ -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,
},
});
Expand Down
8 changes: 2 additions & 6 deletions src/components/PurchaseOrder/PO.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
},
Expand Down
3 changes: 0 additions & 3 deletions src/components/Utils/api.js

This file was deleted.

3 changes: 1 addition & 2 deletions src/routes/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down
10 changes: 2 additions & 8 deletions test/bigtest/network/config.js
Original file line number Diff line number Diff line change
@@ -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;
});

Expand Down

0 comments on commit a171e6c

Please sign in to comment.