Hello <@691710226122145805> ,
Same here i am new on strapi, but stuck on coditional logic for fields in strapi,
Where i have to put the code, like how i can achieve this,
Ex. I have Collection type “post”, it having the field “date” and “sector”, sector is enumeration data type and has values like morning and noon
So i want that if we select morning then “date” field should be hide, while create entry in post collection.
I have tried with lifecycyles.json but nothing is effected the path like
src/api/post/content-types/post/lifecycles.js
module.exports = {
beforeCreate: async (entry) => {
if (entry.sector === ‘morning’) {
delete entry.date;
}
}
};
Please help out me for this issue.
Thanks in advanced.