mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
Pod model refractoring -> use mongoose api
This commit is contained in:
parent
d14b3e37a2
commit
a3ee6fa22d
8 changed files with 111 additions and 99 deletions
|
@ -1,8 +1,10 @@
|
|||
'use strict'
|
||||
|
||||
const logger = require('../helpers/logger')
|
||||
const mongoose = require('mongoose')
|
||||
const peertubeCrypto = require('../helpers/peertubeCrypto')
|
||||
const Pods = require('../models/pods')
|
||||
|
||||
const Pod = mongoose.model('Pod')
|
||||
|
||||
const secureMiddleware = {
|
||||
decryptBody: decryptBody
|
||||
|
@ -10,7 +12,7 @@ const secureMiddleware = {
|
|||
|
||||
function decryptBody (req, res, next) {
|
||||
const url = req.body.signature.url
|
||||
Pods.findByUrl(url, function (err, pod) {
|
||||
Pod.loadByUrl(url, function (err, pod) {
|
||||
if (err) {
|
||||
logger.error('Cannot get signed url in decryptBody.', { error: err })
|
||||
return res.sendStatus(500)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue