diff --git a/api/routes/wars.js b/api/routes/wars.js index 8506b7d..ecb4d8d 100644 --- a/api/routes/wars.js +++ b/api/routes/wars.js @@ -129,10 +129,12 @@ wars.route('/:id') WarModel.findByIdAndRemove(req.params.id, (err, item) => { if (err) { err.status = codes.wrongrequest; + return next(err); } else if (!item) { err = new Error("item not found"); err.status = codes.notfound; + return next(err); } //TODO: add removal of resource files @@ -142,7 +144,7 @@ wars.route('/:id') // we don't set res.locals.items and thus it will send a 204 (no content) at the end. see last handler user.use(..) res.locals.processed = true; - next(err); // this works because err is in normal case undefined and that is the same as no parameter + next(); }) }) diff --git a/static/src/app/army/army.component.html b/static/src/app/army/army.component.html index 7ecee78..7f09601 100644 --- a/static/src/app/army/army.component.html +++ b/static/src/app/army/army.component.html @@ -1,6 +1,6 @@

Übersicht über alle Spieler, Squads und Armeen

-
+

NATO

diff --git a/static/src/app/services/war-service/war.service.ts b/static/src/app/services/war-service/war.service.ts index 343fcfd..cb5e574 100644 --- a/static/src/app/services/war-service/war.service.ts +++ b/static/src/app/services/war-service/war.service.ts @@ -38,5 +38,10 @@ export class WarService { .map(res => res.json()) } + deleteWar(id: string) { + return this.http.delete(this.config.apiUrl + this.config.apiWarPath + '/' + id) + .map(res => res.json()) + } + } diff --git a/static/src/app/wars/war-detail.component.html b/static/src/app/wars/war-detail.component.html index c35ad19..783cbd6 100644 --- a/static/src/app/wars/war-detail.component.html +++ b/static/src/app/wars/war-detail.component.html @@ -10,8 +10,11 @@
- Logfile + Logfile anzeigen +