feat: add IsNewRelease
This commit is contained in:
@@ -144,6 +144,13 @@ module.exports = {
|
||||
let {data} = event.params
|
||||
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({
|
||||
where: {documentId},
|
||||
populate: {difference: true, artistes: true}
|
||||
|
||||
@@ -142,6 +142,10 @@
|
||||
"relation": "oneToMany",
|
||||
"target": "api::parole.parole",
|
||||
"mappedBy": "sourceOriginale"
|
||||
},
|
||||
"isNewRelease": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -540,6 +540,7 @@ export interface ApiParoleParole extends Struct.CollectionTypeSchema {
|
||||
>;
|
||||
forceSlug: Schema.Attribute.Boolean;
|
||||
gadeEmbed: Schema.Attribute.String;
|
||||
isNewRelease: Schema.Attribute.Boolean & Schema.Attribute.DefaultTo<false>;
|
||||
langueSource: Schema.Attribute.Enumeration<
|
||||
['ka', 'fr', 'en', 'es', 'de', 'it']
|
||||
> &
|
||||
|
||||
Reference in New Issue
Block a user