@opinio-dev/models 1.3.1-movie-form.0 → 1.3.1-movie-form.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,7 +13,7 @@ export class BookValidator extends BaseItemValidator {
|
|
|
13
13
|
if (!genres?.length) {
|
|
14
14
|
errors.genres = 'Book genres are required';
|
|
15
15
|
}
|
|
16
|
-
if (!genres?.every((genre) =>
|
|
16
|
+
if (!genres?.every((genre) => BookGenres.includes(genre))) {
|
|
17
17
|
errors.genres = `One or more book genres are invalid. Valid genres are: ${BookGenres.join(', ')}`;
|
|
18
18
|
}
|
|
19
19
|
if (!author) {
|
|
@@ -13,7 +13,7 @@ export class GameValidator extends BaseItemValidator {
|
|
|
13
13
|
if (!genres?.length) {
|
|
14
14
|
errors.genres = 'Game genres are required';
|
|
15
15
|
}
|
|
16
|
-
if (!genres?.every((genre) =>
|
|
16
|
+
if (!genres?.every((genre) => GameGenres.includes(genre))) {
|
|
17
17
|
errors.genres = `One or more game genres are invalid. Valid genres are: ${GameGenres.join(', ')}`;
|
|
18
18
|
}
|
|
19
19
|
if (!platforms?.length) {
|
|
@@ -13,7 +13,7 @@ export class MovieValidator extends BaseItemValidator {
|
|
|
13
13
|
if (!genres?.length) {
|
|
14
14
|
errors.genres = 'Movie genres are required';
|
|
15
15
|
}
|
|
16
|
-
if (!genres?.every((genre) =>
|
|
16
|
+
if (!genres?.every((genre) => VideoGenres.includes(genre))) {
|
|
17
17
|
errors.genres = `One or more movie genres are invalid. Valid genres are: ${VideoGenres.join(', ')}`;
|
|
18
18
|
}
|
|
19
19
|
if (duration === undefined) {
|
|
@@ -14,7 +14,7 @@ export class SeriesValidator extends BaseItemValidator {
|
|
|
14
14
|
if (!genres?.length) {
|
|
15
15
|
errors.genres = 'Series genres are required';
|
|
16
16
|
}
|
|
17
|
-
if (!genres?.every((genre) =>
|
|
17
|
+
if (!genres?.every((genre) => VideoGenres.includes(genre))) {
|
|
18
18
|
errors.genres = `One or more series genres are invalid. Valid genres are: ${VideoGenres.join(', ')}`;
|
|
19
19
|
}
|
|
20
20
|
if (!status) {
|