mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 06:54:03 +02:00
move group endpoint from app unit to api unit
This commit is contained in:
@@ -124,28 +124,6 @@ module.exports = function(options) {
|
||||
res.send('var GLOBAL_APPSTATE = ' + JSON.stringify(state))
|
||||
})
|
||||
|
||||
app.get('/app/api/v1/group', function(req, res) {
|
||||
dbapi.loadGroup(req.user.email)
|
||||
.then(function(cursor) {
|
||||
return Promise.promisify(cursor.toArray, cursor)()
|
||||
.then(function(list) {
|
||||
list.forEach(function(device) {
|
||||
datautil.normalize(device, req.user)
|
||||
})
|
||||
res.json({
|
||||
success: true
|
||||
, devices: list
|
||||
})
|
||||
})
|
||||
})
|
||||
.catch(function(err) {
|
||||
log.error('Failed to load group: ', err.stack)
|
||||
res.json(500, {
|
||||
success: false
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
app.get('/app/api/v1/accessTokens', function(req, res) {
|
||||
dbapi.loadAccessTokens(req.user.email)
|
||||
.then(function(cursor) {
|
||||
|
||||
Reference in New Issue
Block a user