From 6bf7992f0fdbd175ca9611aee1043dddca23b5c6 Mon Sep 17 00:00:00 2001 From: Florian Hartwich Date: Fri, 14 Jul 2017 23:33:17 +0200 Subject: [PATCH] Add war submit form --- api/routes/wars.js | 16 ++-- static/src/app/app.component.html | 10 ++- static/src/app/app.routing.ts | 10 +-- static/src/app/login/login.component.html | 2 +- static/src/app/login/login.guard.ts | 40 ++++++++-- static/src/app/models/model-interfaces.ts | 2 +- .../app/services/war-service/war.service.ts | 7 +- static/src/app/wars/war-detail.component.ts | 1 - static/src/app/wars/war-submit.component.css | 28 +++++++ static/src/app/wars/war-submit.component.html | 75 ++++++++++++++++++ static/src/app/wars/war-submit.component.ts | 72 +++++++++++++++++ static/src/app/wars/wars.routing.ts | 19 +++++ static/src/assets/loading.png | Bin 0 -> 7974 bytes 13 files changed, 250 insertions(+), 32 deletions(-) create mode 100644 static/src/app/wars/war-submit.component.css create mode 100644 static/src/app/wars/war-submit.component.html create mode 100644 static/src/app/wars/war-submit.component.ts create mode 100644 static/src/app/wars/wars.routing.ts create mode 100644 static/src/assets/loading.png diff --git a/api/routes/wars.js b/api/routes/wars.js index f7f6579..8506b7d 100644 --- a/api/routes/wars.js +++ b/api/routes/wars.js @@ -69,16 +69,14 @@ wars.route('/') if (error) { return next(error); } - let obj = JSON.parse(`${stdout}`); - console.log(obj); - PlayerModel.create(obj, function (err) { - if (err) { - return next(err); + exec(__dirname + '/../war-parser/clean.sh /../' + folderName + ' | tee ' + folderName + '/clean.log', (error) => { + if (error) { + return next(error); } - - exec(__dirname + '/../war-parser/clean.sh /../' + folderName + ' | tee ' + folderName + '/clean.log', (error) => { - if (error) { - return next(error); + let obj = JSON.parse(`${stdout}`); + PlayerModel.create(obj, function (err) { + if (err) { + return next(err); } res.status(codes.created); res.locals.items = item; diff --git a/static/src/app/app.component.html b/static/src/app/app.component.html index e8e6db8..5a58439 100644 --- a/static/src/app/app.component.html +++ b/static/src/app/app.component.html @@ -28,8 +28,13 @@ @@ -45,7 +50,8 @@
  • Ränge
  • -