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');
|
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;
|
||||||
|
|
Loading…
Reference in New Issue