jh-be-tools 1.0.35 → 1.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -31,15 +31,27 @@ const request = async (req) => {
|
|
|
31
31
|
let func;
|
|
32
32
|
switch (definition.method) {
|
|
33
33
|
case 'get':
|
|
34
|
+
if (queryData?.body) {
|
|
35
|
+
throw Error('Get requests with body are not supported.');
|
|
36
|
+
}
|
|
34
37
|
func = axios_1.default.get;
|
|
35
38
|
break;
|
|
36
39
|
case 'post':
|
|
37
40
|
func = axios_1.default.post;
|
|
41
|
+
if (queryData && !queryData?.body) {
|
|
42
|
+
queryData.body = null;
|
|
43
|
+
}
|
|
38
44
|
break;
|
|
39
45
|
case 'put':
|
|
40
46
|
func = axios_1.default.put;
|
|
47
|
+
if (queryData && !queryData?.body) {
|
|
48
|
+
queryData.body = null;
|
|
49
|
+
}
|
|
41
50
|
break;
|
|
42
51
|
case 'delete':
|
|
52
|
+
if (queryData?.body) {
|
|
53
|
+
throw Error('Delete requests with body are not supported.');
|
|
54
|
+
}
|
|
43
55
|
func = axios_1.default.delete;
|
|
44
56
|
break;
|
|
45
57
|
}
|