diff --git a/backend/middlewares/SharingMWs.ts b/backend/middlewares/SharingMWs.ts index f9d1637a..99099b68 100644 --- a/backend/middlewares/SharingMWs.ts +++ b/backend/middlewares/SharingMWs.ts @@ -69,6 +69,7 @@ export class SharingMWs { return next(); } catch (err) { + console.warn(err); return next(new ErrorDTO(ErrorCodes.GENERAL_ERROR, 'Error during creating sharing link', err)); } } diff --git a/backend/model/sql/SharingManager.ts b/backend/model/sql/SharingManager.ts index 62a53f19..f33f2c3e 100644 --- a/backend/model/sql/SharingManager.ts +++ b/backend/model/sql/SharingManager.ts @@ -4,12 +4,13 @@ import {SQLConnection} from './SQLConnection'; import {SharingEntity} from './enitites/SharingEntity'; import {Config} from '../../../common/config/private/Config'; import {PasswordHelper} from '../PasswordHelper'; +import {DeleteResult} from 'typeorm'; export class SharingManager implements ISharingManager { - private static async removeExpiredLink() { + private static async removeExpiredLink(): Promise { const connection = await SQLConnection.getConnection(); - return connection + return await connection .getRepository(SharingEntity) .createQueryBuilder('share') .where('expires < :now', {now: Date.now()})