Fix code style

pull/34/head
HardiReady 2018-04-29 09:51:28 +02:00
parent da29c39b88
commit 0bf730e0d4
5 changed files with 6 additions and 7 deletions

View File

@ -4,7 +4,7 @@
###-------------------------------------------------------------###
###------------------- HOW TO USE THIS FILE --------------------###
###-------------------------------------------------------------###
### 1. start express server with `npm run start-test` ###
### 1. start express server with `npm run start-api-test` ###
### 2. import data by executing script: `./populate-data.sh` ###
### 3. change data in app as you need for tests ###
### 4. export data state with: `./populate-data.sh -m save` ###

View File

@ -66,14 +66,14 @@ campaigns.route('/:id')
}
req.body.updatedAt = new Date();
req.body.$inc = { __v: 1 };
req.body.$inc = {__v: 1};
if (req.body.hasOwnProperty('__v')) {
delete req.body.__v;
}
// PATCH is easier with mongoose than PUT. You simply update by all data that comes from outside. no need to
// reset attributes that are missing.
CampaignModel.findByIdAndUpdate(req.params.id, req.body, { new: true }, (err, item) => {
CampaignModel.findByIdAndUpdate(req.params.id, req.body, {new: true}, (err, item) => {
if (err) {
err.status = codes.wrongrequest;
} else if (!item) {
@ -96,7 +96,7 @@ campaigns.route('/:id')
err.status = codes.notfound;
return next(err);
}
WarModel.find({ campaign: req.params.id }).remove().exec();
WarModel.find({campaign: req.params.id}).remove().exec();
// TODO: remove all the war logs from fs here!!!
res.locals.processed = true;
next();

View File

@ -1,7 +1,6 @@
<code_scheme name="OPT-CC" version="173">
<option name="FORMATTER_TAGS_ENABLED" value="true" />
<JSCodeStyleSettings>
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="USE_CHAINED_CALLS_GROUP_INDENTS" value="true" />
</JSCodeStyleSettings>
<TypeScriptCodeStyleSettings>

View File

@ -41,7 +41,7 @@ export class CampaignSubmitComponent {
.subscribe(campaign => {
let redirectSuccessUrl = '../overview/';
if (this.campaign._id) {
redirectSuccessUrl = '../' + redirectSuccessUrl
redirectSuccessUrl = '../' + redirectSuccessUrl;
}
this.router.navigate([redirectSuccessUrl + campaign._id], {relativeTo: this.route});
},

View File

@ -38,7 +38,7 @@ export class WarSubmitComponent {
fileChange(event) {
if (this.validExtensions.filter(ext => event.target.files[0] &&
event.target.files[0].name.endsWith(ext)).length == 1) {
event.target.files[0].name.endsWith(ext)).length === 1) {
this.showFileError = false;
this.fileList = event.target.files;
} else {