@@ -1979,7 +1979,7 @@ describe('hooks with createApi defaults set', () => {
1979
1979
http . get ( 'https://example.com/posts' , ( ) => {
1980
1980
return HttpResponse . json ( posts )
1981
1981
} ) ,
1982
- http . put < Post , Partial < Post > > (
1982
+ http . put < { id : string } , Partial < Post > > (
1983
1983
'https://example.com/post/:id' ,
1984
1984
async ( { request, params } ) => {
1985
1985
const body = await request . json ( ) ;
@@ -2018,7 +2018,7 @@ describe('hooks with createApi defaults set', () => {
2018
2018
} )
2019
2019
2020
2020
interface Post {
2021
- id : string
2021
+ id : number
2022
2022
name : string
2023
2023
fetched_at : string
2024
2024
}
@@ -2092,7 +2092,7 @@ describe('hooks with createApi defaults set', () => {
2092
2092
function SelectedPost ( ) {
2093
2093
const { post } = api . endpoints . getPosts . useQueryState ( undefined , {
2094
2094
selectFromResult : ( { data } ) => ( {
2095
- post : data ?. find ( ( post ) => post . id === 1 as any ) ,
2095
+ post : data ?. find ( ( post ) => post . id === 1 ) ,
2096
2096
} ) ,
2097
2097
} )
2098
2098
getRenderCount = useRenderCounter ( )
@@ -2171,7 +2171,7 @@ describe('hooks with createApi defaults set', () => {
2171
2171
isSuccess,
2172
2172
isError,
2173
2173
} ) => ( {
2174
- post : data ?. find ( ( post ) => post . id === 1 as any ) ,
2174
+ post : data ?. find ( ( post ) => post . id === 1 ) ,
2175
2175
isUninitialized,
2176
2176
isLoading,
2177
2177
isFetching,
@@ -2228,7 +2228,7 @@ describe('hooks with createApi defaults set', () => {
2228
2228
getRenderCount = useRenderCounter ( )
2229
2229
const { post } = api . endpoints . getPosts . useQuery ( undefined , {
2230
2230
selectFromResult : ( { data } ) => ( {
2231
- post : data ?. find ( ( post ) => post . id === 1 as any ) ,
2231
+ post : data ?. find ( ( post ) => post . id === 1 ) ,
2232
2232
} ) ,
2233
2233
} )
2234
2234
@@ -2277,7 +2277,7 @@ describe('hooks with createApi defaults set', () => {
2277
2277
</ button >
2278
2278
< button
2279
2279
data-testid = "updatePost"
2280
- onClick = { ( ) => updatePost ( { id : 1 , name : 'supercoooll!' } as any ) }
2280
+ onClick = { ( ) => updatePost ( { id : 1 , name : 'supercoooll!' } ) }
2281
2281
>
2282
2282
Update post
2283
2283
</ button >
@@ -2288,7 +2288,7 @@ describe('hooks with createApi defaults set', () => {
2288
2288
function SelectedPost ( ) {
2289
2289
const { post } = api . endpoints . getPosts . useQuery ( undefined , {
2290
2290
selectFromResult : ( { data } ) => ( {
2291
- post : data ?. find ( ( post ) => post . id === 1 as any ) ,
2291
+ post : data ?. find ( ( post ) => post . id === 1 ) ,
2292
2292
} ) ,
2293
2293
} )
2294
2294
getRenderCount = useRenderCounter ( )
0 commit comments