Open Codfisher opened 3 weeks ago
When using CacheInterceptor, the response data of the first request is normal, but the response data of the second request becomes empty.
The usage follows the documentation as described: https://docs.nestjs.com/techniques/caching#auto-caching-responses
Cache content should not be empty.
@UseInterceptors(CacheInterceptor) @Controller() export class SingleDataController { constructor( ... ) { } @TsRestHandler(singleDataContract.get, { validateResponses: true }) async get() { return tsRestHandler(singleDataContract.get, async () => { const [error, data] = await to(this.singleDataService.get()); if (error) { throw new HttpException( 'error message', HttpStatus.INTERNAL_SERVER_ERROR, ); } return { status: 200, body: data.toJSON(), }; }); } }
3.30.4
Describe the bug
When using CacheInterceptor, the response data of the first request is normal, but the response data of the second request becomes empty.
How to reproduce
The usage follows the documentation as described: https://docs.nestjs.com/techniques/caching#auto-caching-responses
Expected behavior
Cache content should not be empty.
Code reproduction
ts-rest version
3.30.4