mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-11 21:08:36 +03:00
implicit ids in events
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Joi from 'joi'
|
||||
|
||||
const eventSchema = Joi.object().keys({
|
||||
id: Joi.string().required(),
|
||||
id: Joi.string().allow(''),
|
||||
description: Joi.string().allow('').required(),
|
||||
date: Joi.string().allow(''),
|
||||
time: Joi.string().allow(''),
|
||||
|
||||
@@ -164,7 +164,8 @@ export function validateDomain (domain) {
|
||||
sanitizedDomain.filters = domain.filters
|
||||
|
||||
// append events with datetime and sort
|
||||
sanitizedDomain.events.forEach(event => {
|
||||
sanitizedDomain.events.forEach((event, idx) => {
|
||||
event.id = idx
|
||||
event.datetime = calcDatetime(event.date, event.time)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user