From 0bf730e0d47d8233d5887307773fc538a1fc6c1e Mon Sep 17 00:00:00 2001 From: HardiReady Date: Sun, 29 Apr 2018 09:51:28 +0200 Subject: [PATCH] Fix code style --- api/apib/dredd/populate-data.sh | 2 +- api/routes/campaigns.js | 6 +++--- .../cc-intellij-idea-javascript-typescript-style.xml | 1 - .../statistic/campaign-submit/campaign-submit.component.ts | 2 +- static/src/app/statistic/war-submit/war-submit.component.ts | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/api/apib/dredd/populate-data.sh b/api/apib/dredd/populate-data.sh index 47dc954..3544f4d 100755 --- a/api/apib/dredd/populate-data.sh +++ b/api/apib/dredd/populate-data.sh @@ -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` ### diff --git a/api/routes/campaigns.js b/api/routes/campaigns.js index f42bb4a..c992cbf 100644 --- a/api/routes/campaigns.js +++ b/api/routes/campaigns.js @@ -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(); diff --git a/docs/infra/codestyle/cc-intellij-idea-javascript-typescript-style.xml b/docs/infra/codestyle/cc-intellij-idea-javascript-typescript-style.xml index e1c7def..185cecc 100644 --- a/docs/infra/codestyle/cc-intellij-idea-javascript-typescript-style.xml +++ b/docs/infra/codestyle/cc-intellij-idea-javascript-typescript-style.xml @@ -1,7 +1,6 @@