diff --git a/api/apib/dredd/data/war.json b/api/apib/dredd/data/war.json index ec8d2ee..4978a30 100644 --- a/api/apib/dredd/data/war.json +++ b/api/apib/dredd/data/war.json @@ -1,2 +1,3 @@ {"_id":{"$oid":"5abf65d83fc5fa349ffd5cbb"},"playersBlufor":4,"playersOpfor":4,"budgetBlufor":4535500,"budgetOpfor":4221250,"endBudgetBlufor":997000,"endBudgetOpfor":512000,"title":"Battle #1","campaign":{"$oid":"5abd55ea9e30a76bfef747d6"},"date":{"$date":"2018-03-19T23:00:00.000Z"},"endDate":{"$date":"2018-03-20T01:30:00.000Z"},"ptBlufor":34,"ptOpfor":25,"timestamp":{"$date":"2018-03-31T10:41:28.451Z"},"updatedAt":{"$date":"2018-03-31T10:41:28.451Z"},"__v":0} {"_id":{"$oid":"5abf65ae3fc5fa349ffd5ca3"},"playersBlufor":4,"playersOpfor":4,"budgetBlufor":4535500,"budgetOpfor":4221250,"endBudgetBlufor":997000,"endBudgetOpfor":512000,"title":"Test Battle #0","campaign":{"$oid":"5abd55ea9e30a76bfef747d6"},"date":{"$date":"2018-03-19T23:00:00.000Z"},"endDate":{"$date":"2018-03-20T01:30:00.000Z"},"ptBlufor":34,"ptOpfor":25,"timestamp":{"$date":"2018-03-31T10:40:46.695Z"},"updatedAt":{"$date":"2018-03-31T10:40:46.695Z"},"__v":0} +{"_id":{"$oid":"5abf65ae2df5fa349ffd5ca3"},"playersBlufor":20,"playersOpfor":20,"budgetBlufor":4535500,"budgetOpfor":4535500,"endBudgetBlufor":0,"endBudgetOpfor":20000,"title":"Test Battle XY","campaign":{"$oid":"5abd55ea9e30a76bfef747d6"},"date":{"$date":"2018-03-02T23:00:00.000Z"},"endDate":{"$date":"2018-03-02T01:30:00.000Z"},"ptBlufor":34,"ptOpfor":25,"timestamp":{"$date":"2018-03-02T10:40:46.695Z"},"updatedAt":{"$date":"2018-03-02T10:40:46.695Z"},"__v":0} diff --git a/api/apib/statistics/wars.apib b/api/apib/statistics/wars.apib index 6ce40bb..c370a9c 100644 --- a/api/apib/statistics/wars.apib +++ b/api/apib/statistics/wars.apib @@ -76,6 +76,35 @@ Create a new war + Attributes (War, fixed-type) +### Update War [PATCH /wars/{id}] + +Update a war, identified by its id + +**Permission: 3** + ++ Parameters + + id: `5abf65ae2df5fa349ffd5ca3` (string, required) - unique id of campaign + ++ Request (application/json) + + + Attributes + + _id: `5abf65ae2df5fa349ffd5ca3` (string, required) - unique id of war + + title: `Final Touchdown` (string, optional) - display name of the war + + date: `2017-05-11T20:00:00.471Z` (string, optional) - starting date + + endDate: `2017-05-12T00:30:32.471Z` (string, optional) - end date + + ptBlufor: 5 (number, optional) - points Blufor + + ptOpfor: 5 (number, optional) - points Opfor + + playersBlufor: 20 (number, optional) - number of players Blufor + + playersOpfor: 20 (number, optional) - number of players Opfor + + budgetBlufor: 3000000 (number, optional) - start budget Blufor + + budgetOpfor: 3000000 (number, optional) - start budget Opfor + + endBudgetBlufor: 10000 (number, optional) - end budget Blufor + + endBudgetOpfor: 12000 (number, optional) - end budget Opfor + ++ Response 200 (application/json; charset=utf-8) + + + Attributes (War, fixed-type) + ### Delete War [DELETE /wars/{id}] Delete a war diff --git a/static/src/app/statistic/stats.routing.ts b/static/src/app/statistic/stats.routing.ts index f020788..b2f7302 100644 --- a/static/src/app/statistic/stats.routing.ts +++ b/static/src/app/statistic/stats.routing.ts @@ -10,9 +10,9 @@ import {ScoreboardComponent} from './war/scoreboard/scoreboard.component'; import {WarSubmitComponent} from './war/war-submit/war-submit.component'; import {FractionStatsComponent} from './war/fraction-stats/fraction-stats.component'; import {StatisticHighScoreComponent} from './campaign/highscore/highscore.component'; -import {WarHeaderComponent} from "./war/war-header/war-header.component"; -import {WarEditComponent} from "./war/war-edit/war-edit.component"; -import {LoginGuardMT} from "../login"; +import {WarHeaderComponent} from './war/war-header/war-header.component'; +import {WarEditComponent} from './war/war-edit/war-edit.component'; +import {LoginGuardMT} from '../login'; export const statsRoutes: Routes = [{ diff --git a/static/src/app/statistic/war/war-edit/war-edit.component.ts b/static/src/app/statistic/war/war-edit/war-edit.component.ts index 254241b..96be8cf 100644 --- a/static/src/app/statistic/war/war-edit/war-edit.component.ts +++ b/static/src/app/statistic/war/war-edit/war-edit.component.ts @@ -3,7 +3,7 @@ import {ActivatedRoute, Router} from '@angular/router'; import {NgForm} from '@angular/forms'; import {WarService} from '../../../services/logs/war.service'; import {War} from '../../../models/model-interfaces'; -import {CampaignService} from "../../../services/logs/campaign.service"; +import {CampaignService} from '../../../services/logs/campaign.service'; import {Subscription} from 'rxjs/Subscription'; diff --git a/static/src/app/statistic/war/war-list/war-list.component.ts b/static/src/app/statistic/war/war-list/war-list.component.ts index bb18ed0..b64fc1c 100644 --- a/static/src/app/statistic/war/war-list/war-list.component.ts +++ b/static/src/app/statistic/war/war-list/war-list.component.ts @@ -88,8 +88,8 @@ export class WarListComponent implements OnInit { this.selectOverview('all'); } this.campaigns.forEach(campaign => { - campaign.wars.splice(campaign.wars.indexOf(war),1) - }) + campaign.wars.splice(campaign.wars.indexOf(war), 1); + }); }); } }