Skip to content

Commit b2e59c7

Browse files
authored
fix: change download file schema (#1912)
1 parent a69948d commit b2e59c7

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

src/services/item/plugins/importExport/importExport.controller.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ const plugin: FastifyPluginAsyncTypebox = async (fastify) => {
135135
reply.raw.setHeader('Content-Disposition', `attachment; filename="${encodeFilename(name)}"`);
136136
reply.type(mimetype);
137137

138-
// BUG: cast because validation does not match
139-
return stream as never;
138+
return stream;
140139
},
141140
);
142141

src/services/item/plugins/importExport/importExport.schemas.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ export const downloadFile = {
3535
}),
3636
response: {
3737
// return a stream
38-
[StatusCodes.OK]: Type.Object(
39-
{ data: Type.String() },
40-
{ description: 'a stream of data for the export zip content' },
41-
),
38+
[StatusCodes.OK]: Type.Any({ description: 'a stream of data for the export zip content' }),
4239
'4xx': errorSchemaRef,
4340
},
4441
} as const satisfies FastifySchema;
@@ -54,7 +51,6 @@ export const exportZip = {
5451
itemId: customType.UUID(),
5552
}),
5653
response: {
57-
// return a stream
5854
[StatusCodes.ACCEPTED]: Type.Null({ description: 'email with download link has been sent' }),
5955
'4xx': errorSchemaRef,
6056
},

0 commit comments

Comments
 (0)