fix: undefined

This commit is contained in:
diced 2022-12-08 18:53:35 -08:00
parent 2c07d6719e
commit d87e465a8e
No known key found for this signature in database
GPG key ID: 370BD1BA142842D1

View file

@ -7,6 +7,8 @@ function postFileDecorator(fastify: FastifyInstance, _: unknown, done: () => voi
done();
async function postFile(this: FastifyReply, file: Image) {
if (!file) return true;
const nFile = await this.server.prisma.image.update({
where: { id: file.id },
data: { views: { increment: 1 } },