mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 12:53:32 +00:00
Feat/excel (#45)
* add dependency adding dependency to parse the excel file in the node side * import file ability to import file - add extension - safeguard file type and size * user is able to upload json or excel * chore: extract logic into self contained function * associate model with version * test id generation * parse excel data * prevent UI crash on bad data * extract validation into self contained function * chore: add more tests for bad data * config: stop from opening browser on start * fix comma in sample db * handle corrupt files * error boundary around main components * jsdocs * increase id length * parse excel time string * feat: excel parsing * validate json db before import * chore: test event validator * feat: make function to clean convert strings * chore: test parser * chore: jsdocs * fix: bug on upload prevent bug where the component would prevent upload of same file twice
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
import { db, data } from '../app.js';
|
||||
|
||||
// utils
|
||||
import { customAlphabet } from 'nanoid';
|
||||
const nanoid = customAlphabet('1234567890abcdef', 4);
|
||||
import { generateId } from '../utils/generate_id.js';
|
||||
import {
|
||||
event as eventDef,
|
||||
delay as delayDef,
|
||||
@@ -98,7 +97,7 @@ export const eventsPost = async (req, res) => {
|
||||
|
||||
// ensure structure
|
||||
let newEvent = {};
|
||||
req.body.id = nanoid();
|
||||
req.body.id = generateId();
|
||||
|
||||
switch (req.body.type) {
|
||||
case 'event':
|
||||
|
||||
Reference in New Issue
Block a user