From 23d25364d4687325f6e590836a54cdf11a7cc896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Famibelle-Pronzola?= Date: Sun, 5 Mar 2023 12:58:16 +0400 Subject: [PATCH] Fix prevent error when no artiste --- src/api/parole/content-types/parole/lifecycles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/parole/content-types/parole/lifecycles.js b/src/api/parole/content-types/parole/lifecycles.js index f9a27bb..c04e2a9 100644 --- a/src/api/parole/content-types/parole/lifecycles.js +++ b/src/api/parole/content-types/parole/lifecycles.js @@ -26,7 +26,7 @@ const isSlugExists = async existingSlug => { } const jwennAwtisEpiId = async artistesIds => { - if (!artistesIds) { + if (artistesIds.length === 0) { throw new ValidationError('Champ obligatoire. Veuillez choisir au moins un artiste.'); }