System Information
- Strapi Version:
- Operating System:
- Database:
- Node Version:
- NPM Version:
- Yarn Version:
I’m looking to highlight a field in the admin panel from an error in a lifecycle event. The docs just have foo: bar
I’ve tried adding fields names for foo, and guessing bar is the actual error message.
export default {
async beforeUpdate(event) {
const example = await strapi
.query("api::example.example")
.findOne({ id: event.params.where.id });
const exampleUpdated = { ...example, ...event.params.data };
if (exampleUpdated.category == null) {
// throw new ApplicationError("Something went wrong category", {
throw new ValidationError("Something went wrong category", {
for: "bar", // from strapi docs
});
}
},
};```