From bbe62ece6e94b8610186c71fc94bbee022f0ecca Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 18 Nov 2024 08:46:48 +0100 Subject: [PATCH] fix: refs #7917 model --- modules/supplier/back/models/supplier.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js index 0acb36341..86f124d88 100644 --- a/modules/supplier/back/models/supplier.js +++ b/modules/supplier/back/models/supplier.js @@ -164,8 +164,7 @@ module.exports = Self => { throw new UserError('The social name has an invalid format'); }); - Self.isSupplier = async(ctx, options = {}) => { - const userId = ctx.req.accessToken.userId; + Self.isSupplier = async(userId, options = {}) => { const client = await Self.app.models.Client.findById(userId, options); const supplier = await Self.app.models.Supplier.findOne({where: {nif: client.fi}}, options); return supplier;