This commit is contained in:
parent
5e7dea94b1
commit
bbe62ece6e
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue