Skip to content

Commit 596e933

Browse files
committed
Changes param name for reduce() function for the purpose of logic
1 parent ef6eb4d commit 596e933

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

api/utils/url.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ export function mapUrl(availableActions = {}, url = []) {
66
return notFound;
77
}
88
/*eslint-disable */
9-
const reducer = (next, current) => {
10-
if (next.action && next.action[current]) {
11-
return {action: next.action[current], params: []}; // go deeper
9+
const reducer = (prev, current) => {
10+
if (prev.action && prev.action[current]) {
11+
return {action: prev.action[current], params: []}; // go deeper
1212
} else {
13-
if (typeof next.action === 'function') {
14-
return {action: next.action, params: next.params.concat(current)}; // params are found
13+
if (typeof prev.action === 'function') {
14+
return {action: prev.action, params: prev.params.concat(current)}; // params are found
1515
} else {
1616
return notFound;
1717
}

0 commit comments

Comments
 (0)