fix: refs #7917 fix methods, tests, acls #3085

Closed
carlossa wants to merge 35 commits from 7917-freelancerRoute into dev
1 changed files with 1 additions and 2 deletions
Showing only changes of commit bbe62ece6e - Show all commits

View File

@ -164,8 +164,7 @@ module.exports = Self => {
throw new UserError('The social name has an invalid format'); throw new UserError('The social name has an invalid format');
}); });
Self.isSupplier = async(ctx, options = {}) => { Self.isSupplier = async(userId, options = {}) => {
const userId = ctx.req.accessToken.userId;
const client = await Self.app.models.Client.findById(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); const supplier = await Self.app.models.Supplier.findOne({where: {nif: client.fi}}, options);
return supplier; return supplier;