mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-08 08:53:51 +00:00
Feature/#276/qrcodes (#289)
* bugfix: wrong format when on 12h format * update: website link in placeholder --------- Co-authored-by: Fabian Posenau <fabian@fphome.de> Co-authored-by: cv <34649812+cpvalente@users.noreply.github.com>
This commit is contained in:
@@ -16,8 +16,9 @@ export const postEvent = async (req, res) => {
|
||||
try {
|
||||
const newEvent = removeUndefined({
|
||||
title: req.body?.title,
|
||||
url: req.body?.url,
|
||||
publicUrl: req.body?.publicUrl,
|
||||
publicInfo: req.body?.publicInfo,
|
||||
backstageUrl: req.body?.backstageUrl,
|
||||
backstageInfo: req.body?.backstageInfo,
|
||||
endMessage: req.body?.endMessage,
|
||||
});
|
||||
|
||||
@@ -2,8 +2,9 @@ import { body, validationResult } from 'express-validator';
|
||||
|
||||
export const eventSanitizer = [
|
||||
body('title').optional().isString().trim(),
|
||||
body('url').optional().isString().trim(),
|
||||
body('publicUrl').optional().isString().trim(),
|
||||
body('publicInfo').optional().isString().trim(),
|
||||
body('backstageUrl').optional().isString().trim(),
|
||||
body('backstageInfo').optional().isString().trim(),
|
||||
body('endMessage').optional().isString().trim(),
|
||||
(req, res, next) => {
|
||||
|
||||
@@ -2,8 +2,9 @@ export const dbModel = {
|
||||
rundown: [],
|
||||
event: {
|
||||
title: '',
|
||||
url: '',
|
||||
publicUrl: '',
|
||||
publicInfo: '',
|
||||
backstageUrl: '',
|
||||
backstageInfo: '',
|
||||
endMessage: '',
|
||||
},
|
||||
|
||||
@@ -27,7 +27,8 @@ export const JSON_MIME = 'application/json';
|
||||
export const parseExcel = async (excelData) => {
|
||||
const eventData = {
|
||||
title: '',
|
||||
url: '',
|
||||
publicUrl: '',
|
||||
backstageUrl: '',
|
||||
};
|
||||
const customUserFields = {};
|
||||
const rundown = [];
|
||||
@@ -55,8 +56,9 @@ export const parseExcel = async (excelData) => {
|
||||
.filter((e) => e.length > 0)
|
||||
.forEach((row) => {
|
||||
let eventTitleNext = false;
|
||||
let eventUrlNext = false;
|
||||
let publicUrlNext = false;
|
||||
let publicInfoNext = false;
|
||||
let backstageUrlNext = false;
|
||||
let backstageInfoNext = false;
|
||||
let endMessageNext = false;
|
||||
const event = {};
|
||||
@@ -66,12 +68,15 @@ export const parseExcel = async (excelData) => {
|
||||
if (eventTitleNext) {
|
||||
eventData.title = column;
|
||||
eventTitleNext = false;
|
||||
} else if (eventUrlNext) {
|
||||
eventData.url = column;
|
||||
eventUrlNext = false;
|
||||
} else if (publicUrlNext) {
|
||||
eventData.publicUrl = column;
|
||||
publicUrlNext = false;
|
||||
} else if (publicInfoNext) {
|
||||
eventData.publicInfo = column;
|
||||
publicInfoNext = false;
|
||||
} else if (backstageUrlNext) {
|
||||
eventData.publicUrl = column;
|
||||
backstageUrlNext = false;
|
||||
} else if (backstageInfoNext) {
|
||||
eventData.backstageInfo = column;
|
||||
backstageInfoNext = false;
|
||||
@@ -125,12 +130,15 @@ export const parseExcel = async (excelData) => {
|
||||
case 'event name':
|
||||
eventTitleNext = true;
|
||||
break;
|
||||
case 'event url':
|
||||
eventUrlNext = true;
|
||||
case 'public url':
|
||||
publicUrlNext = true;
|
||||
break;
|
||||
case 'public info':
|
||||
publicInfoNext = true;
|
||||
break;
|
||||
case 'backstage url':
|
||||
backstageUrlNext = true;
|
||||
break;
|
||||
case 'backstage info':
|
||||
backstageInfoNext = true;
|
||||
break;
|
||||
|
||||
@@ -71,8 +71,9 @@ export const parseEvent = (data, enforce) => {
|
||||
newEvent = {
|
||||
...dbModel.event,
|
||||
title: e.title || dbModel.event.title,
|
||||
url: e.url || dbModel.event.url,
|
||||
publicUrl: e.publicUrl || dbModel.event.publicUrl,
|
||||
publicInfo: e.publicInfo || dbModel.event.publicInfo,
|
||||
backstageUrl: e.backstageUrl || dbModel.event.backstageUrl,
|
||||
backstageInfo: e.backstageInfo || dbModel.event.backstageInfo,
|
||||
endMessage: e.endMessage || dbModel.event.endMessage,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user