You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi All,
the documentation of loopback 4 does not contain validations for createAll method at interceptors. Can anyone guide me on how do we validate for createAll method?
console.log('log: before-', invocationCtx.methodName);
const order: Order = new Order();
if (invocationCtx.methodName == 'create')
Object.assign(order, invocationCtx.args[0]);
else if (invocationCtx.methodName == 'updateById')
Object.assign(order, invocationCtx.args[1]);
if (order.orderNum.length !== 6) {
throw new HttpErrors.InternalServerError('Invalid order number');
}
const result = await next();
return result;
};
The text was updated successfully, but these errors were encountered:
@smithasmi95 sorry I don't think I follow as your code snippet does not illustrate any createAll logic. Some tips if the question is not related to this repo I would suggest you ask it on Slack or via LoopBack monorepo
Hi All,
the documentation of loopback 4 does not contain validations for createAll method at interceptors. Can anyone guide me on how do we validate for createAll method?
const validateOrder: Interceptor = async (invocationCtx, next) => {
};
The text was updated successfully, but these errors were encountered: