Skip to content

Commit 579d2e1

Browse files
committed
Fix no-unsafe-optional-chaining related problems
1 parent 61d688c commit 579d2e1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/toolkit/src/query/tests/buildHooks.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2886,7 +2886,7 @@ describe('hooks with createApi defaults set', () => {
28862886
const defaultApi = createApi({
28872887
baseQuery: async (arg: any) => {
28882888
await waitMs()
2889-
if ('amount' in arg?.body) {
2889+
if ('body' in arg && 'amount' in arg.body) {
28902890
amount += 1
28912891
}
28922892
return {
@@ -3460,7 +3460,7 @@ describe('hooks with createApi defaults set', () => {
34603460
const api = createApi({
34613461
baseQuery: async (arg: any) => {
34623462
await waitMs()
3463-
if ('amount' in arg?.body) {
3463+
if ('body' in arg && 'amount' in arg.body) {
34643464
amount += 1
34653465
}
34663466
return {

packages/toolkit/src/query/tests/refetchingBehaviors.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let amount = 0
1111
const defaultApi = createApi({
1212
baseQuery: async (arg: any) => {
1313
await delay(150)
14-
if ('amount' in arg?.body) {
14+
if ('body' in arg && 'amount' in arg.body) {
1515
amount += 1
1616
}
1717
return {

0 commit comments

Comments
 (0)