Skip to content

Commit

Permalink
Merge pull request #30 from lexich/hpaul-patch-1
Browse files Browse the repository at this point in the history
Hpaul patch 1
  • Loading branch information
lexich committed Dec 11, 2015
2 parents 9ef50ef + dca5250 commit 0ac75b6
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "redux-api",
"version": "0.7.0",
"version": "0.7.1",
"main": "dist/redux-api.min.js",
"dependencies": {}
}
2 changes: 1 addition & 1 deletion dist/redux-api.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/redux-api.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/redux-api.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/redux-api.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "redux-api",
"version": "0.7.0",
"version": "0.7.1",
"author": {
"name": "Efremov Alex",
"email": "lexich121@gmail.com",
Expand Down
2 changes: 1 addition & 1 deletion src/actionFn.js
Expand Up @@ -51,7 +51,7 @@ export default function actionFn(url, name, options, ACTIONS={}, meta={}) {
const rootUrl = meta.holder ? meta.holder.rootUrl : null;
let urlT = resultUrlT;
if (rootUrl) {
const urlObject = libUrl.parse(url);
const urlObject = libUrl.parse(urlT);
if (!urlObject.host) {
const urlPath = (rootUrl.path ? rootUrl.path.replace(/\/$/, "") : "") +
"/" + (urlObject.path ? urlObject.path.replace(/^\//, "") : "");
Expand Down
12 changes: 6 additions & 6 deletions test/index_spec.js
Expand Up @@ -40,14 +40,14 @@ describe("index", function() {
test1: "/url1/",
test2: "url2",
test3: "",
test4: "/"
test4: "/(:id)"
}).init(fetchUrl, false, "http://api.com/root");

const res2 = reduxApi({
test1: "/url1/",
test2: "url2",
test3: "",
test4: "/"
test4: "/(:id)"
}).init(fetchUrl, false, "http://api.ru/");

const act = res.actions;
Expand All @@ -56,21 +56,21 @@ describe("index", function() {
act.test1.request(),
act.test2.request(),
act.test3.request(),
act.test4.request(),
act.test4.request({ id: 1 }),
act2.test1.request(),
act2.test2.request(),
act2.test3.request(),
act2.test4.request()
act2.test4.request({ id: 2 })
]).then(()=> {
expect([
"http://api.com/root/url1/",
"http://api.com/root/url2",
"http://api.com/root/",
"http://api.com/root/",
"http://api.com/root/1",
"http://api.ru/url1/",
"http://api.ru/url2",
"http://api.ru/",
"http://api.ru/"
"http://api.ru/2"
]).to.eql(urls);
});
});
Expand Down

0 comments on commit 0ac75b6

Please sign in to comment.