From 89d589ba0031ded969ba51c2e31eb46dab587480 Mon Sep 17 00:00:00 2001 From: ignassew Date: Wed, 3 Jul 2024 11:45:37 +0200 Subject: [PATCH] fix: Make response undefined when status code is 204 --- src/transform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transform.ts b/src/transform.ts index a385dd3..37a75a7 100644 --- a/src/transform.ts +++ b/src/transform.ts @@ -73,7 +73,7 @@ export function transformToHandlerCode(operationCollection: OperationCollection) const resultArray = [${op.response.map(response => { const identifier = getResIdentifierName(response); return parseInt(response?.code!) === 204 - ? `[null, { status: ${parseInt(response?.code!)} }]` + ? `[undefined, { status: ${parseInt(response?.code!)} }]` : `[${identifier ? `${identifier}()` : 'null'}, { status: ${parseInt(response?.code!)} }]`; })}];