Skip to content

Commit

Permalink
Merge pull request #4 from brewfactory/fix/log-action
Browse files Browse the repository at this point in the history
Fix log action
  • Loading branch information
hekike committed Nov 5, 2014
2 parents fe51c92 + 26413c5 commit edfe3f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "brew-ui",
"version": "1.3.0",
"version": "1.3.1",
"description": "Common User Interface for the Brewfactory projects.",
"authors": [
"Peter Marton, @slashdotpeter"
Expand Down Expand Up @@ -28,7 +28,7 @@
"chart.js": "^1.0.1-beta.2",
"debug": "^2.0.0",
"dispatchr": "^0.2.7",
"flux-router-component": "git://github.com/hekike/flux-router-component#feature/update-react-v12",
"flux-router-component": "^0.4.3",
"lodash-node": "^2.4.1",
"moment": "^2.8.3",
"react": "^0.12.0",
Expand Down
16 changes: 5 additions & 11 deletions src/scripts/app/actions/logs/findBrew.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,12 @@ module.exports = function (context, payload, done) {
.then(function (resp) {
var brews = resp.brews;

logFetcher.findOne({ id: brews[0]._id }).then(function (selectedResp) {
var selectedBrew = selectedResp.brews;
debug('dispatching FIND_LOG_SUCCESS', brews);
context.dispatch(LogConstants.ActionTypes.FIND_LOG_SUCCESS, brews);

debug('dispatching FIND_LOG_SUCCESS', brews);

context.dispatch(LogConstants.ActionTypes.FIND_ONE_LOG_SUCCESS, selectedBrew);
context.dispatch(LogConstants.ActionTypes.FIND_LOG_SUCCESS, brews);

if(typeof done === 'function') {
done(null, brews);
}
});
if(typeof done === 'function') {
done(null, brews);
}
})
.catch(function (err) {
debug('FIND_LOG error', err);
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ App.prototype.init = function () {
}

// FInd selected brew
actionContext.executeAction(findOneBrewLogAction, { id: brews[0].id }, function (err) {
actionContext.executeAction(findOneBrewLogAction, { id: brews[0]._id }, function (err) {
if(err) {
return reject(err);
}
Expand Down

0 comments on commit edfe3f7

Please sign in to comment.