Add apib doc for update war
parent
6bc6d14b6d
commit
63a89ebf7b
|
@ -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":"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":"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}
|
||||||
|
|
|
@ -76,6 +76,35 @@ Create a new war
|
||||||
|
|
||||||
+ Attributes (War, fixed-type)
|
+ 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 War [DELETE /wars/{id}]
|
||||||
|
|
||||||
Delete a war
|
Delete a war
|
||||||
|
|
|
@ -10,9 +10,9 @@ import {ScoreboardComponent} from './war/scoreboard/scoreboard.component';
|
||||||
import {WarSubmitComponent} from './war/war-submit/war-submit.component';
|
import {WarSubmitComponent} from './war/war-submit/war-submit.component';
|
||||||
import {FractionStatsComponent} from './war/fraction-stats/fraction-stats.component';
|
import {FractionStatsComponent} from './war/fraction-stats/fraction-stats.component';
|
||||||
import {StatisticHighScoreComponent} from './campaign/highscore/highscore.component';
|
import {StatisticHighScoreComponent} from './campaign/highscore/highscore.component';
|
||||||
import {WarHeaderComponent} from "./war/war-header/war-header.component";
|
import {WarHeaderComponent} from './war/war-header/war-header.component';
|
||||||
import {WarEditComponent} from "./war/war-edit/war-edit.component";
|
import {WarEditComponent} from './war/war-edit/war-edit.component';
|
||||||
import {LoginGuardMT} from "../login";
|
import {LoginGuardMT} from '../login';
|
||||||
|
|
||||||
|
|
||||||
export const statsRoutes: Routes = [{
|
export const statsRoutes: Routes = [{
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {NgForm} from '@angular/forms';
|
import {NgForm} from '@angular/forms';
|
||||||
import {WarService} from '../../../services/logs/war.service';
|
import {WarService} from '../../../services/logs/war.service';
|
||||||
import {War} from '../../../models/model-interfaces';
|
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';
|
import {Subscription} from 'rxjs/Subscription';
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -88,8 +88,8 @@ export class WarListComponent implements OnInit {
|
||||||
this.selectOverview('all');
|
this.selectOverview('all');
|
||||||
}
|
}
|
||||||
this.campaigns.forEach(campaign => {
|
this.campaigns.forEach(campaign => {
|
||||||
campaign.wars.splice(campaign.wars.indexOf(war),1)
|
campaign.wars.splice(campaign.wars.indexOf(war), 1);
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue