mirror of
https://github.com/diced/zipline.git
synced 2025-04-11 23:31:17 -05:00
add thumbnail for type
This commit is contained in:
parent
ad2ba18189
commit
9c4bb02769
1 changed files with 2 additions and 2 deletions
|
@ -12,7 +12,7 @@ function rawFileDecorator(fastify: FastifyInstance, _, done) {
|
|||
fastify.decorateReply('rawFile', rawFile);
|
||||
done();
|
||||
|
||||
async function rawFile(this: FastifyReply, file: Partial<File> & { thumbnail: Partial<Thumbnail> }) {
|
||||
async function rawFile(this: FastifyReply, file: Partial<File> & { thumbnail?: Partial<Thumbnail> }) {
|
||||
const { download, compress = 'false' } = this.request.query as { download?: string; compress?: string };
|
||||
const isThumb = (this.request.params['id'] as string) === file.thumbnail?.name,
|
||||
filename = isThumb ? file.thumbnail?.name : file.name,
|
||||
|
@ -120,6 +120,6 @@ export default fastifyPlugin(rawFileDecorator, {
|
|||
|
||||
declare module 'fastify' {
|
||||
interface FastifyReply {
|
||||
rawFile: (file: Partial<File> & { thumbnail: Partial<Thumbnail> }) => Promise<void>;
|
||||
rawFile: (file: Partial<File> & { thumbnail?: Partial<Thumbnail> }) => Promise<void>;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue