mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-29 17:07:08 +08:00
added collection and allowed to settings
This commit is contained in:
@@ -13,6 +13,17 @@ app.get('/settings', function(req, res) {
|
||||
;
|
||||
});
|
||||
|
||||
app.post('/settings', function(req, res) {
|
||||
Settings
|
||||
.spawn()
|
||||
.for(req)
|
||||
.find({name: req.body.name, plugin: req.body.name})
|
||||
.set(req.body)
|
||||
.notify(res)
|
||||
.save()
|
||||
;
|
||||
});
|
||||
|
||||
app.get('/settings/:name', function(req, res) {
|
||||
Setting
|
||||
.spawn()
|
||||
@@ -23,19 +34,11 @@ app.get('/settings/:name', function(req, res) {
|
||||
;
|
||||
});
|
||||
|
||||
var Model = require('../../model').spawn();
|
||||
Model.unlock();
|
||||
Model.collection = 'system.indexes';
|
||||
Model.notify(function(data) {
|
||||
config.indexes = data;
|
||||
|
||||
Setting
|
||||
.spawn()
|
||||
.find({name: 'app'})
|
||||
.set(config)
|
||||
.set({name: 'app'})
|
||||
.save()
|
||||
;
|
||||
}).fetch();
|
||||
|
||||
// create or update app settings
|
||||
// create or update general app settings
|
||||
Setting
|
||||
.spawn()
|
||||
.find({name: 'app'})
|
||||
.set(config)
|
||||
.set({name: 'app'})
|
||||
.save()
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user