feat: add IsNewRelease
Déploiement API PROD / build (push) Successful in 2m10s
Déploiement API PROD / deploy (push) Successful in 50s

This commit is contained in:
2026-06-17 08:49:14 +04:00
parent 95156de4ca
commit ea0f56c202
3 changed files with 12 additions and 0 deletions
@@ -144,6 +144,13 @@ module.exports = {
let {data} = event.params let {data} = event.params
const {documentId} = data const {documentId} = data
if (data.isNewRelease === true) {
await strapi.db.query('api::parole.parole').updateMany({
where: { isNewRelease: true },
data: { isNewRelease: false },
})
}
const previousParoles = await strapi.db.query('api::parole.parole').findOne({ const previousParoles = await strapi.db.query('api::parole.parole').findOne({
where: {documentId}, where: {documentId},
populate: {difference: true, artistes: true} populate: {difference: true, artistes: true}
@@ -142,6 +142,10 @@
"relation": "oneToMany", "relation": "oneToMany",
"target": "api::parole.parole", "target": "api::parole.parole",
"mappedBy": "sourceOriginale" "mappedBy": "sourceOriginale"
},
"isNewRelease": {
"type": "boolean",
"default": false
} }
} }
} }
+1
View File
@@ -540,6 +540,7 @@ export interface ApiParoleParole extends Struct.CollectionTypeSchema {
>; >;
forceSlug: Schema.Attribute.Boolean; forceSlug: Schema.Attribute.Boolean;
gadeEmbed: Schema.Attribute.String; gadeEmbed: Schema.Attribute.String;
isNewRelease: Schema.Attribute.Boolean & Schema.Attribute.DefaultTo<false>;
langueSource: Schema.Attribute.Enumeration< langueSource: Schema.Attribute.Enumeration<
['ka', 'fr', 'en', 'es', 'de', 'it'] ['ka', 'fr', 'en', 'es', 'de', 'it']
> & > &