Skip to content

Commit 73fd8ec

Browse files
committed
Fix no-unsafe-optional-chaining related problems
1 parent 7dd9724 commit 73fd8ec

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
@@ -2786,7 +2786,7 @@ describe('hooks with createApi defaults set', () => {
27862786
const defaultApi = createApi({
27872787
baseQuery: async (arg: any) => {
27882788
await waitMs()
2789-
if ('amount' in arg?.body) {
2789+
if ('body' in arg && 'amount' in arg.body) {
27902790
amount += 1
27912791
}
27922792
return {
@@ -3360,7 +3360,7 @@ describe('hooks with createApi defaults set', () => {
33603360
const api = createApi({
33613361
baseQuery: async (arg: any) => {
33623362
await waitMs()
3363-
if ('amount' in arg?.body) {
3363+
if ('body' in arg && 'amount' in arg.body) {
33643364
amount += 1
33653365
}
33663366
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)