Skip to content

Commit 20b8109

Browse files
committed
tweaks
1 parent b687b07 commit 20b8109

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
"plugin:@typescript-eslint/recommended"
4646
],
4747
"rules": {
48-
"@typescript-eslint/no-explicit-any": "off"
48+
"@typescript-eslint/no-explicit-any": "off",
49+
"@typescript-eslint/no-empty-function": "off"
4950
},
5051
"env": {
5152
"browser": true

src/LiveComponent/assets/dist/live_controller.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,8 @@ class default_1 extends Controller {
11561156
}
11571157
if (!dataAdded) {
11581158
fetchOptions.method = 'POST';
1159-
fetchOptions.body = JSON.stringify({ data: this.dataValue });
1159+
fetchOptions.body = JSON.stringify(this.dataValue);
1160+
fetchOptions.headers['Content-Type'] = 'application/json';
11601161
}
11611162
this._onLoadingStart();
11621163
const paramsString = params.toString();

src/LiveComponent/assets/test/controller/action.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('LiveController Action Tests', () => {
6666
expect(getByLabelText(element, 'Comments:')).toHaveValue('hi weaver');
6767

6868
const bodyData = JSON.parse(postMock.lastOptions().body);
69-
expect(bodyData.data.comments).toEqual('hi WEAVER');
69+
expect(bodyData.comments).toEqual('hi WEAVER');
7070
});
7171

7272
it('Sends action named args', async () => {

src/LiveComponent/assets/test/controller/render.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ describe('LiveController rendering Tests', () => {
132132
mockRerender(
133133
{ name: 'Ryan' },
134134
() => '<div>aloha!</div>',
135-
() => {},
135+
() => { },
136136
{ delay: 100 }
137137
);
138138

0 commit comments

Comments
 (0)