server-ts: Remove use of (req as any)

This commit is contained in:
Elian Doran
2024-04-07 14:29:08 +03:00
parent 7fe6d1ab4d
commit 34cd2eba91
7 changed files with 36 additions and 21 deletions

View File

@@ -14,11 +14,12 @@ import ValidationError = require('../../errors/validation_error');
import { Request, Response } from 'express';
import BNote = require('../../becca/entities/bnote');
import BAttachment = require('../../becca/entities/battachment');
import { AppRequest } from '../route-interface';
function updateFile(req: Request) {
function updateFile(req: AppRequest) {
const note = becca.getNoteOrThrow(req.params.noteId);
const file = (req as any).file;
const file = req.file;
note.saveRevision();
note.mime = file.mimetype.toLowerCase();
@@ -35,9 +36,9 @@ function updateFile(req: Request) {
};
}
function updateAttachment(req: Request) {
function updateAttachment(req: AppRequest) {
const attachment = becca.getAttachmentOrThrow(req.params.attachmentId);
const file = (req as any).file;
const file = req.file;
attachment.getNote().saveRevision();