Move models to typescript-sequelize
This commit is contained in:
parent
c893d4514e
commit
3fd3ab2d34
150 changed files with 3676 additions and 5074 deletions
|
@ -2,13 +2,13 @@ import * as express from 'express'
|
|||
import { Activity } from '../../../shared/models/activitypub/activity'
|
||||
import { activityPubCollectionPagination } from '../../helpers/activitypub'
|
||||
import { pageToStartAndCount } from '../../helpers/core-utils'
|
||||
import { database as db } from '../../initializers'
|
||||
import { ACTIVITY_PUB } from '../../initializers/constants'
|
||||
import { addActivityData } from '../../lib/activitypub/send/send-add'
|
||||
import { getAnnounceActivityPubUrl } from '../../lib/activitypub/url'
|
||||
import { announceActivityData } from '../../lib/index'
|
||||
import { asyncMiddleware, localAccountValidator } from '../../middlewares'
|
||||
import { AccountInstance } from '../../models/account/account-interface'
|
||||
import { AccountModel } from '../../models/account/account'
|
||||
import { VideoModel } from '../../models/video/video'
|
||||
|
||||
const outboxRouter = express.Router()
|
||||
|
||||
|
@ -26,12 +26,12 @@ export {
|
|||
// ---------------------------------------------------------------------------
|
||||
|
||||
async function outboxController (req: express.Request, res: express.Response, next: express.NextFunction) {
|
||||
const account: AccountInstance = res.locals.account
|
||||
const account: AccountModel = res.locals.account
|
||||
|
||||
const page = req.query.page || 1
|
||||
const { start, count } = pageToStartAndCount(page, ACTIVITY_PUB.COLLECTION_ITEMS_PER_PAGE)
|
||||
|
||||
const data = await db.Video.listAllAndSharedByAccountForOutbox(account.id, start, count)
|
||||
const data = await VideoModel.listAllAndSharedByAccountForOutbox(account.id, start, count)
|
||||
const activities: Activity[] = []
|
||||
|
||||
for (const video of data.data) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue