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:
parent
f68d1cb6ac
commit
fa47956ecf
18 changed files with 237 additions and 80 deletions
18
server/models/shared/update.ts
Normal file
18
server/models/shared/update.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { QueryTypes, Transaction } from 'sequelize'
|
||||
import { sequelizeTypescript } from '@server/initializers/database'
|
||||
|
||||
// Sequelize always skip the update if we only update updatedAt field
|
||||
function setAsUpdated (table: string, id: number, transaction?: Transaction) {
|
||||
return sequelizeTypescript.query(
|
||||
`UPDATE "${table}" SET "updatedAt" = :updatedAt WHERE id = :id`,
|
||||
{
|
||||
replacements: { table, id, updatedAt: new Date() },
|
||||
type: QueryTypes.UPDATE,
|
||||
transaction
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export {
|
||||
setAsUpdated
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue