This is a workaround and it works as aspected, but could I use it with a decorator? The only thing I can think of is the following:
@Get()
@SetHeader('X-Total-Count', '2') // Value needs to be pulled from somewhere in the function below
async list(@Res() res: NextApiResponse) {
const items = await db.user.findMany();
return items;
}
Is this just not possbile with decorators? Let me know, thanks!
Let's say I have a list function like this:
And now, I need to add a header with 'X-total-Count'. How would I approach this using a decorator? For example, I currently use the following:
This is a workaround and it works as aspected, but could I use it with a decorator? The only thing I can think of is the following:
Is this just not possbile with decorators? Let me know, thanks!