From 3fd1317577914ff9591ef20b3cfe1fae20fd2ee0 Mon Sep 17 00:00:00 2001 From: Adriano Raiano Date: Thu, 24 Oct 2013 12:32:34 +0200 Subject: [PATCH] ## v0.5.2 --- README.md | 4 ++++ lib/commandDispatcher.js | 6 +++++- package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ea46b15..5eb2f43 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,10 @@ See [tests](https://github.com/adrai/node-cqrs-domain/tree/master/test) for deta # Release Notes +## v0.5.2 + +- fix commandDispatcher if no commandqueue is used + ## v0.5.0 - a complete change of validation rules (see new [rule-validator](https://github.com/adrai/rule-validator)) diff --git a/lib/commandDispatcher.js b/lib/commandDispatcher.js index 08027eb..be4268e 100644 --- a/lib/commandDispatcher.js +++ b/lib/commandDispatcher.js @@ -72,7 +72,11 @@ module.exports = { // use provided aggregateId or get one from commandQueue function(callback) { if (!commandQueue) { - return callback(null, uuid().toString()); + if (cmd.payload && cmd.payload.id) { + return callback(null, cmd.payload.id); + } else { + return callback(null, uuid().toString()); + } } if (options.forcedQueuing) { diff --git a/package.json b/package.json index 3652d8e..cdf1619 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "adrai", "name": "cqrs-domain", - "version": "0.5.1", + "version": "0.5.2", "private": false, "main": "index.js", "engines": {