Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Commit 8e6a2ad

Browse files
authored
Merge pull request #47 from SpringRoll/161/third-times-the-charm
fix releases bugs
2 parents c419f14 + 613613b commit 8e6a2ad

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SpringRoll Connect is a content management system built using [NodeJS](https://n
1111

1212
* Install the latest version of [Docker](https://www.docker.com/)
1313
* Copy `sample.env` to `.env`. You can modify these values, but for development you shouldn't have to
14-
* Run `docker-compose up --build` which should build both the mongo db server
14+
* Run `docker-compose up --build` which should build the mongo db server
1515
* Run `node server.js` which should start the application server
1616
* You should then seed the database with some information by running `node seed.js`
1717
* Running `seed.js` will also output the password for a user `admin`

app/routes/releases/release.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ router.patch('/:commit_id', async function(req, res)
4242
}
4343

4444
req.body.updated = Date.now();
45-
await Release.findByIdAndUpdate(req.body.release, req.body);
4645
let release = await Release.getByCommitId(req.body.commitId);
46+
req.body.game = release.game;
47+
await Release.findByIdAndUpdate(release._id, req.body);
4748
let game = await Game.getById(release.game);
4849
let baseUrl = '';
4950
if (!game.isArchived){

app/views/games/releases-controls.jade

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
if isEditor
22
form.controls.pull-right(action="/releases/#{release.commitId}" method="post")
33
input(type="hidden" name="release" value=release._id)
4+
input(type="hidden" name="game" value=game.slug)
45
input(type="hidden" name="action" value="DELETE")
56
button.btn.btn-block.btn-default.dropdown-toggle(data-toggle="confirm" type="submit")
67
span.glyphicon.glyphicon-trash

0 commit comments

Comments
 (0)