We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66227ae commit ecfa811Copy full SHA for ecfa811
src/BootstrapBlazor/wwwroot/modules/ajax.js
@@ -14,14 +14,13 @@
14
15
let result = null;
16
try {
17
- const toJson = option.toJson;
18
- delete option.toJson;
19
- result = await fetch(option.url, {
20
- method: option.method,
+ const { toJson, url, method, data } = option;
+ result = await fetch(url, {
+ method: method,
21
headers: {
22
'Content-Type': 'application/json'
23
},
24
- body: option.method === 'POST' ? JSON.stringify(option.data) : null
+ body: method === 'POST' ? JSON.stringify(data) : null
25
});
26
if (toJson === true) {
27
result = await result.json()
0 commit comments