Skip to content

Commit 577dfd7

Browse files
committed
Fix no-unsafe-optional-chaining related problems
1 parent 11046bc commit 577dfd7

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
@@ -2249,7 +2249,7 @@ describe('hooks with createApi defaults set', () => {
22492249
const defaultApi = createApi({
22502250
baseQuery: async (arg: any) => {
22512251
await waitMs()
2252-
if ('amount' in arg?.body) {
2252+
if ('body' in arg && 'amount' in arg.body) {
22532253
amount += 1
22542254
}
22552255
return {
@@ -2823,7 +2823,7 @@ describe('hooks with createApi defaults set', () => {
28232823
const api = createApi({
28242824
baseQuery: async (arg: any) => {
28252825
await waitMs()
2826-
if ('amount' in arg?.body) {
2826+
if ('body' in arg && 'amount' in arg.body) {
28272827
amount += 1
28282828
}
28292829
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)