Add modification for post logic and add fields on user / contact

This commit is contained in:
2025-09-30 19:59:29 +02:00
parent a84fdbed9a
commit e7f91f1a7f
20 changed files with 20617 additions and 26 deletions

View File

@@ -41,7 +41,7 @@ export default {
});
if (!alreadyExists) {
await strapi.db.query("api::post.post").create({
const post = await strapi.db.query("api::post.post").create({
data: {
title: article.title,
content: article.description,
@@ -55,6 +55,15 @@ export default {
},
});
// Créer le postOwnership associé
await strapi.db.query("api::post-ownership.post-ownership").create({
data: {
post: post.id,
contextType: "system",
relation: "owner",
},
});
strapi.log.info(`🆕 Article créé : ${article.title}`);
} else {
strapi.log.info(`🔁 Article déjà existant : ${article.title}`);