From be73c073bd6e82b73649ca97617b33231b21e7d0 Mon Sep 17 00:00:00 2001 From: Jay's Date: Sat, 24 Jun 2023 16:35:04 +0200 Subject: [PATCH] Update schema.js --- src/schema.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/schema.js b/src/schema.js index bfbd61f..7a53a3c 100644 --- a/src/schema.js +++ b/src/schema.js @@ -93,8 +93,13 @@ function createFileSchema(bucket) { return done(error); } // read file details - // eslint-disable-next-line no-underscore-dangle - return this.constructor.findById(created._id).then(res => done(res)).catch(err => done(err)); + return ( + this.constructor + // eslint-disable-next-line no-underscore-dangle + .findById(created._id) + .then((res) => done(null, res)) + .catch((err) => done(err)) + ); }.bind(this) ); };