Skip to content

Commit bf2a975

Browse files
committed
Fix positional argument bug with contextData
1 parent ba759a6 commit bf2a975

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22

33
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
44

5+
### [1.9.1](https://github.com/doesdev/get-scrud/compare/1.9.0...1.9.1)
6+
7+
> 2022-04-23
8+
9+
- Handle case where `contextData` becomes unset
10+
511
### [1.9.0](https://github.com/doesdev/get-scrud/compare/1.8.1...1.9.0)
612

7-
> 2022-04-21
13+
> 2022-04-23
814
915
- Add `throttle` option
1016
- Pass `contextData` through to `before` function call

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ var source = (function () {
187187
if (api && _typeof(api) === 'object') return setOpts(api);
188188
return new Promise(function (resolve, reject) {
189189
if (!Number.isInteger(id) && typeof id !== 'string') {
190+
contextData = jwt;
190191
jwt = body;
191192
body = id;
192193
id = null;

module.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ var source = (function () {
179179
if (api && _typeof(api) === 'object') return setOpts(api);
180180
return new Promise(function (resolve, reject) {
181181
if (!Number.isInteger(id) && typeof id !== 'string') {
182+
contextData = jwt;
182183
jwt = body;
183184
body = id;
184185
id = null;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "get-scrud",
3-
"version": "1.9.0",
3+
"version": "1.9.1",
44
"description": "Client for SCRUD style rest APIs",
55
"main": "index.js",
66
"module": "module.js",
@@ -50,4 +50,4 @@
5050
"pre-commit": "rollup -c && mvt && git add index.js module.js"
5151
}
5252
}
53-
}
53+
}

source.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export default (opts = {}) => {
100100

101101
return new Promise((resolve, reject) => {
102102
if (!Number.isInteger(id) && typeof id !== 'string') {
103+
contextData = jwt
103104
jwt = body
104105
body = id
105106
id = null

0 commit comments

Comments
 (0)