1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Filter host for channels and playlists search

This commit is contained in:
Chocobozzz 2021-07-28 10:32:40 +02:00
parent f68d1cb6ac
commit fa47956ecf
No known key found for this signature in database
GPG key ID: 583A612D890159BE
18 changed files with 237 additions and 80 deletions

View file

@ -0,0 +1,17 @@
import { BindOrReplacements, QueryTypes } from 'sequelize'
import { sequelizeTypescript } from '@server/initializers/database'
function doesExist (query: string, bind?: BindOrReplacements) {
const options = {
type: QueryTypes.SELECT as QueryTypes.SELECT,
bind,
raw: true
}
return sequelizeTypescript.query(query, options)
.then(results => results.length === 1)
}
export {
doesExist
}