mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
Merge pull request #81 from finn-no/namingEvents
#80 Rename event types
This commit is contained in:
commit
9af098f432
@ -9,8 +9,8 @@ var strategyTypes = [
|
|||||||
var featureTypes = [
|
var featureTypes = [
|
||||||
eventType.featureCreated,
|
eventType.featureCreated,
|
||||||
eventType.featureUpdated,
|
eventType.featureUpdated,
|
||||||
eventType.featureArchive,
|
eventType.featureArchived,
|
||||||
eventType.featureRevive
|
eventType.featureRevived
|
||||||
];
|
];
|
||||||
|
|
||||||
function baseTypeFor(event) {
|
function baseTypeFor(event) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
featureCreated : 'feature-created',
|
featureCreated : 'feature-created',
|
||||||
featureUpdated : 'feature-updated',
|
featureUpdated : 'feature-updated',
|
||||||
featureArchive : 'feature-archive',
|
featureArchived : 'feature-archived',
|
||||||
featureRevive : 'feature-revive',
|
featureRevived : 'feature-revived',
|
||||||
strategyCreated: 'strategy-created',
|
strategyCreated: 'strategy-created',
|
||||||
strategyDeleted: 'strategy-deleted'
|
strategyDeleted: 'strategy-deleted'
|
||||||
};
|
};
|
@ -89,7 +89,7 @@ module.exports = function (app) {
|
|||||||
featureDb.getFeature(featureName)
|
featureDb.getFeature(featureName)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return eventStore.create({
|
return eventStore.create({
|
||||||
type: eventType.featureArchive,
|
type: eventType.featureArchived,
|
||||||
createdBy: userName,
|
createdBy: userName,
|
||||||
data: {
|
data: {
|
||||||
name: featureName
|
name: featureName
|
||||||
|
@ -19,7 +19,7 @@ module.exports = function (app) {
|
|||||||
validateRequest(req)
|
validateRequest(req)
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return eventStore.create({
|
return eventStore.create({
|
||||||
type: eventType.featureRevive,
|
type: eventType.featureRevived,
|
||||||
createdBy: req.connection.remoteAddress,
|
createdBy: req.connection.remoteAddress,
|
||||||
data: req.body
|
data: req.body
|
||||||
});
|
});
|
||||||
|
@ -13,11 +13,11 @@ eventStore.on(eventType.featureUpdated, function (event) {
|
|||||||
return updateFeature(event.data);
|
return updateFeature(event.data);
|
||||||
});
|
});
|
||||||
|
|
||||||
eventStore.on(eventType.featureArchive, function (event) {
|
eventStore.on(eventType.featureArchived, function (event) {
|
||||||
return archiveFeature(event.data);
|
return archiveFeature(event.data);
|
||||||
});
|
});
|
||||||
|
|
||||||
eventStore.on(eventType.featureRevive, function (event) {
|
eventStore.on(eventType.featureRevived, function (event) {
|
||||||
return reviveFeature(event.data);
|
return reviveFeature(event.data);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
1
migrations/20150210152531-006-rename-eventtype.js
Normal file
1
migrations/20150210152531-006-rename-eventtype.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
module.exports = require('../lib/migrationRunner').create('006-rename-eventtype');
|
2
migrations/sql/006-rename-eventtype.down.sql
Normal file
2
migrations/sql/006-rename-eventtype.down.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
UPDATE events SET type='feature-revive' WHERE type='feature-revived';
|
||||||
|
UPDATE events SET type='feature-archive' WHERE type='feature-archived';
|
2
migrations/sql/006-rename-eventtype.up.sql
Normal file
2
migrations/sql/006-rename-eventtype.up.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
UPDATE events SET type='feature-revived' WHERE type='feature-revive';
|
||||||
|
UPDATE events SET type='feature-archived' WHERE type='feature-archive';
|
Loading…
Reference in New Issue
Block a user