mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 21:38:35 +03:00
allow events without time
This commit is contained in:
committed by
Franc Camps-Febrer
parent
e25a634cf6
commit
798d0b0703
@@ -3,22 +3,25 @@ import Joi from 'joi';
|
||||
const eventSchema = Joi.object().keys({
|
||||
id: Joi.string().required(),
|
||||
description: Joi.string().allow('').required(),
|
||||
date: Joi.string().required(),
|
||||
time: Joi.string().required(),
|
||||
date: Joi.string().allow(''),
|
||||
time: Joi.string().allow(''),
|
||||
time_precision: Joi.string().allow(''),
|
||||
location: Joi.string().allow('').required(),
|
||||
latitude: Joi.string().allow('').required(),
|
||||
longitude: Joi.string().allow('').required(),
|
||||
location: Joi.string().allow(''),
|
||||
latitude: Joi.string().allow(''),
|
||||
longitude: Joi.string().allow(''),
|
||||
type: Joi.string().allow(''),
|
||||
category: Joi.string().required(),
|
||||
narratives: Joi.array(),
|
||||
sources: Joi.array(),
|
||||
tags: Joi.array().allow(''),
|
||||
comments: Joi.string().allow(''),
|
||||
timestamp: Joi.string().required(),
|
||||
timestamp: Joi.string(),
|
||||
|
||||
// nested
|
||||
narrative___stepStyles: Joi.array(),
|
||||
});
|
||||
})
|
||||
.and('latitude', 'longitude')
|
||||
.and('date', 'time', 'timestamp')
|
||||
.or('timestamp', 'latitude')
|
||||
|
||||
export default eventSchema;
|
||||
export default eventSchema
|
||||
|
||||
Reference in New Issue
Block a user