Skip to content

Commit 1b87582

Browse files
committed
Fix no-unsafe-optional-chaining related problems
1 parent 68d8af9 commit 1b87582

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
@@ -1924,7 +1924,7 @@ describe('hooks with createApi defaults set', () => {
19241924
const defaultApi = createApi({
19251925
baseQuery: async (arg: any) => {
19261926
await waitMs()
1927-
if ('amount' in arg?.body) {
1927+
if ('body' in arg && 'amount' in arg.body) {
19281928
amount += 1
19291929
}
19301930
return {
@@ -2498,7 +2498,7 @@ describe('hooks with createApi defaults set', () => {
24982498
const api = createApi({
24992499
baseQuery: async (arg: any) => {
25002500
await waitMs()
2501-
if ('amount' in arg?.body) {
2501+
if ('body' in arg && 'amount' in arg.body) {
25022502
amount += 1
25032503
}
25042504
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)