From 3c33821f83685b58585702c5a33cf29b9a0dc600 Mon Sep 17 00:00:00 2001 From: edisonjpadilla Date: Wed, 20 Sep 2023 20:58:59 -0400 Subject: [PATCH] [PB-557] bug: file size from the drive-server comes as string --- src/app/models/file.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/models/file.ts b/src/app/models/file.ts index e14122cc..c82fe8bc 100644 --- a/src/app/models/file.ts +++ b/src/app/models/file.ts @@ -58,6 +58,10 @@ export default (database: Sequelize): FileModel => { }, size: { type: DataTypes.BIGINT.UNSIGNED, + get(): number { + const rawValue = this.getDataValue('size'); + return typeof rawValue === 'number' ? rawValue : parseInt(rawValue); + } }, bucket: { type: DataTypes.STRING(24),