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

Commit 7ce4e58

Browse files
authored
Merge pull request #492 from FlowzPlatform/custom-service-flowzdata
setup seprate socket for custom service
2 parents 9406eee + 794779f commit 7ce4e58

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

client/src/pages/flow/New.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
}
143143
for (let m of jsonXML[type]) {
144144
// let obj = m
145-
145+
146146
m.type = type.toLowerCase()
147147
allProcess.push(m)
148148
}
@@ -222,7 +222,7 @@
222222
223223
let actionsObj = {}
224224
for (let i = 0; i < actions.length; i++) {
225-
actionsObj[actions[i]] = this.permissions
225+
actionsObj[actions[i].toLowerCase()] = this.permissions
226226
}
227227
subscriptionNew.moduleResource.moduleName = 'workflow_' + this.$route.params.id
228228
let registerAppModuleNew = actionsObj

service/src/services/dflowzdata/dflowzdata.class.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,24 @@ class Service {
66
constructor (options) {
77
this.options = options || {};
88
this.service = new createServiceMain(options);
9-
this.rDB = this.service.options.r(this.service.options.db);
9+
this.rDB = this.service.options.r.db(this.service.options.db);
1010
}
1111

1212
setup(app) {
1313
this.app = app;
14+
// this.service.watchChangefeeds(app);
15+
this.on('created',(data) => {
16+
this.app.io.emit(this.service.options.name+'_created', data);
17+
});
18+
this.on('updated',(data) => {
19+
this.app.io.emit(this.service.options.name+'_updated', data);
20+
});
21+
this.on('patched',(data) => {
22+
this.app.io.emit(this.service.options.name+'_updated', data);
23+
});
24+
this.on('removed',(data) => {
25+
this.app.io.emit(this.service.options.name+'_removed', data);
26+
});
1427
}
1528
setTableName (params) {
1629
this.service.options.name = params.headers.ftablename;

service/src/services/dflowzdata/dflowzdata.service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = function () {
1818

1919
// Get our initialized service so that we can register hooks and filters
2020
const service = app.service('dflowzdata');
21-
21+
service.watch = false;
2222
service.hooks(hooks);
2323
// console.log('=======',Object.keys(app.services),'=========');
2424
};

0 commit comments

Comments
 (0)