diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-06-28 20:10:32 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-06-28 20:10:32 +0200 |
commit | 00057e85a703713a8f0d96e01c49978be0987eb2 (patch) | |
tree | 54735435062d2ededa72448de9fcaa677cf2c79c /server/models/pods.js | |
parent | aaf61f3810e6d57c5130af959bd2860df32775e7 (diff) | |
download | PeerTube-00057e85a703713a8f0d96e01c49978be0987eb2.tar.gz PeerTube-00057e85a703713a8f0d96e01c49978be0987eb2.tar.zst PeerTube-00057e85a703713a8f0d96e01c49978be0987eb2.zip |
Request model refractoring -> use mongoose api
Diffstat (limited to 'server/models/pods.js')
-rw-r--r-- | server/models/pods.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/models/pods.js b/server/models/pods.js index daeadeb07..9502d92e4 100644 --- a/server/models/pods.js +++ b/server/models/pods.js | |||
@@ -1,6 +1,7 @@ | |||
1 | 'use strict' | 1 | 'use strict' |
2 | 2 | ||
3 | const mongoose = require('mongoose') | 3 | const mongoose = require('mongoose') |
4 | const map = require('lodash/map') | ||
4 | 5 | ||
5 | const constants = require('../initializers/constants') | 6 | const constants = require('../initializers/constants') |
6 | const logger = require('../helpers/logger') | 7 | const logger = require('../helpers/logger') |
@@ -76,7 +77,11 @@ function list (callback) { | |||
76 | } | 77 | } |
77 | 78 | ||
78 | function listAllIds (callback) { | 79 | function listAllIds (callback) { |
79 | return PodsDB.find({}, { _id: 1 }, callback) | 80 | return PodsDB.find({}, { _id: 1 }, function (err, pods) { |
81 | if (err) return callback(err) | ||
82 | |||
83 | return callback(null, map(pods, '_id')) | ||
84 | }) | ||
80 | } | 85 | } |
81 | 86 | ||
82 | function listAllUrls (callback) { | 87 | function listAllUrls (callback) { |