Commit 29bfba43 authored by David Björkheim's avatar David Björkheim Committed by Oyvind
Browse files

DEICH-5645 Deichman.no: Remove unfetch

parent 2a1485c3
......@@ -7,7 +7,7 @@
"": {
"name": "deichman-next",
"version": "1.0.0",
"license": "ISC",
"license": "GPL-3.0-only",
"dependencies": {
"@digibib/deichman-ui": "^7.2.2",
"@nrk/core-tabs": "^2.0.6",
......@@ -26,7 +26,6 @@
"formik": "^2.2.6",
"full-icu": "^1.2.1",
"helmet": "^4.1.1",
"isomorphic-unfetch": "^3.0.0",
"jsonld": "^5.0.0",
"jsonwebtoken": "^8.5.1",
"lodash": "^4.17.20",
......@@ -7599,15 +7598,6 @@
"node": ">=0.10.0"
}
},
"node_modules/isomorphic-unfetch": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz",
"integrity": "sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q==",
"dependencies": {
"node-fetch": "^2.6.1",
"unfetch": "^4.2.0"
}
},
"node_modules/jest-worker": {
"version": "24.9.0",
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz",
......@@ -19574,11 +19564,6 @@
"debug": "^2.2.0"
}
},
"node_modules/unfetch": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/unfetch/-/unfetch-4.2.0.tgz",
"integrity": "sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA=="
},
"node_modules/union-value": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
......@@ -27438,15 +27423,6 @@
"isarray": "1.0.0"
}
},
"isomorphic-unfetch": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/isomorphic-unfetch/-/isomorphic-unfetch-3.1.0.tgz",
"integrity": "sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q==",
"requires": {
"node-fetch": "^2.6.1",
"unfetch": "^4.2.0"
}
},
"jest-worker": {
"version": "24.9.0",
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz",
......@@ -37251,11 +37227,6 @@
"debug": "^2.2.0"
}
},
"unfetch": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/unfetch/-/unfetch-4.2.0.tgz",
"integrity": "sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA=="
},
"union-value": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
......@@ -33,7 +33,6 @@
"formik": "^2.2.6",
"full-icu": "^1.2.1",
"helmet": "^4.1.1",
"isomorphic-unfetch": "^3.0.0",
"jsonld": "^5.0.0",
"jsonwebtoken": "^8.5.1",
"lodash": "^4.17.20",
......
import "isomorphic-unfetch";
import React, { Component, Fragment } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
......
import "isomorphic-unfetch";
import React, { Component, Fragment } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
......
import "isomorphic-unfetch";
import React, { Component, Fragment } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
......@@ -31,12 +30,13 @@ class ListPage extends Component {
"field.status": "published"
};
// Determine what mediatype to display
const mediaTypeQuery = URL_TO_QUERY_MAP[mediaType];
const invalidMediaType = mediaTypeQuery === undefined;
await reduxStore.dispatch(getLists(req, queryWithFilter, mediaTypeQuery, page));
await reduxStore.dispatch(
getLists(req, queryWithFilter, mediaTypeQuery, page)
);
return {
mediaType,
......
import "isomorphic-unfetch";
import React, { Component, Fragment } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
......
import "isomorphic-unfetch";
import React, { Component, Fragment } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
......
import "isomorphic-unfetch";
import React, { Component, Fragment } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
......
import "isomorphic-unfetch";
import React, { Component, Fragment } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
......
import "isomorphic-unfetch";
import React, { Component, Fragment } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
......@@ -149,7 +148,14 @@ SearchPage.propTypes = {
function mapStateToProps(state) {
const { listMode } = state.application;
const { biblioNumbers } = state.favourites;
const { currentQuery, results, overlayVisible, searchApi, agentResults, agentSearchApi } = state.search;
const {
currentQuery,
results,
overlayVisible,
searchApi,
agentResults,
agentSearchApi
} = state.search;
return {
favourites: biblioNumbers,
overlayVisible,
......
/* eslint-disable camelcase */
const fetch = require("isomorphic-unfetch");
const router = require("express").Router();
const jwt = require("jsonwebtoken");
const { verifyToken } = require("../utils/tokenChecker");
......
const routes = require("express").Router();
const fetch = require("isomorphic-unfetch");
const QueryString = require("query-string");
const logger = require("../../logger")(__filename);
......
const isofetch = require("isomorphic-unfetch");
const fetch = require("isomorphic-unfetch");
const { parseString } = require("xml2js");
const router = require("express").Router();
const cookieParser = require("../utils/cookieParser");
......@@ -190,7 +188,7 @@ router.post("/start-pay-fine", async (request, response) => {
}
}
const res = await isofetch(registerUrl);
const res = await fetch(registerUrl);
const xmlResponse = await res.text();
const jsonResponse = await xml2jsPromiseParser(xmlResponse);
const transactionId = jsonResponse.RegisterResponse.TransactionId;
......@@ -261,7 +259,7 @@ router.put("/process-fine-payment", async (request, response) => {
call_id: deichmanCallId
}
);
const res = await isofetch(processUrl);
const res = await fetch(processUrl);
const xmlResponse = await res.text();
const jsonResponse = await xml2jsPromiseParser(xmlResponse);
......
const router = require("express").Router();
const fetch = require("isomorphic-unfetch");
const kohaEndpoint = process.env.INTERNAL_URL_KOHA;
......
const resources = require("express").Router();
const fetch = require("isomorphic-unfetch");
const cookieParser = require("../utils/cookieParser");
const logger = require("../../logger")(__filename);
......
const router = require("express").Router();
const jwt = require("jsonwebtoken");
const fetch = require("isomorphic-unfetch");
const logger = require("../../logger")(__filename);
const { verifyToken } = require("../utils/tokenChecker");
......
const routes = require("express").Router();
const fetch = require("isomorphic-unfetch");
const logger = require("../../logger")(__filename);
const format = require("date-fns/format");
const {
......@@ -71,7 +70,7 @@ function filterLibraries(libraries, categorycode) {
"fsme",
"fsto",
"ftor",
"fgam",
"fgam"
].includes(l.branchcode)
) {
return true;
......@@ -79,7 +78,6 @@ function filterLibraries(libraries, categorycode) {
// allow test branch codes also
return /^[a-f0-9]{8}$/.test(l.branchcode);
});
}
......@@ -94,7 +92,9 @@ routes.get("/koha-branches", async (request, response) => {
response.status(res.status).send(res.statusText);
throw Error();
}
response.status(200).send(filterLibraries(json, request.query.categorycode));
response
.status(200)
.send(filterLibraries(json, request.query.categorycode));
} catch (error) {
logger.info(`ERROR in fetchin all libraries; ${error}`, {
...error,
......
const fetch = require("isomorphic-unfetch");
const router = require("express").Router();
const jwt = require("jsonwebtoken");
const { tokenChecker } = require("../utils/tokenChecker");
......
const fetch = require("isomorphic-unfetch");
const router = require("express").Router();
const jwt = require("jsonwebtoken");
const { tokenChecker } = require("../utils/tokenChecker");
......@@ -32,7 +31,6 @@ async function updatePin(borrowerNumber, newPin, deichmannCallId) {
});
}
// ---- Routes
// Change pin
......@@ -67,7 +65,6 @@ router.put("/", tokenChecker, async (request, response) => {
});
response.sendStatus(500);
}
});
module.exports = router;
/* eslint-disable camelcase */
const userSettingsMapper = require("../utils/userSettingsMapper");
const fetch = require("isomorphic-unfetch");
const router = require("express").Router();
const cookieParser = require("../utils/cookieParser");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment