diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-12 17:53:50 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-13 16:50:33 +0100 |
commit | 3fd3ab2d34d512b160a5e6084d7609be7b4f4452 (patch) | |
tree | e5ca358287fca6ecacce83defcf23af1e8e9f419 /server/controllers/activitypub/outbox.ts | |
parent | c893d4514e6ecbf282c7985fe5f82b8acd8a1137 (diff) | |
download | PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.gz PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.zst PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.zip |
Move models to typescript-sequelize
Diffstat (limited to 'server/controllers/activitypub/outbox.ts')
-rw-r--r-- | server/controllers/activitypub/outbox.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/controllers/activitypub/outbox.ts b/server/controllers/activitypub/outbox.ts index 5a2d43f3d..dc6b72a6e 100644 --- a/server/controllers/activitypub/outbox.ts +++ b/server/controllers/activitypub/outbox.ts | |||
@@ -2,13 +2,13 @@ import * as express from 'express' | |||
2 | import { Activity } from '../../../shared/models/activitypub/activity' | 2 | import { Activity } from '../../../shared/models/activitypub/activity' |
3 | import { activityPubCollectionPagination } from '../../helpers/activitypub' | 3 | import { activityPubCollectionPagination } from '../../helpers/activitypub' |
4 | import { pageToStartAndCount } from '../../helpers/core-utils' | 4 | import { pageToStartAndCount } from '../../helpers/core-utils' |
5 | import { database as db } from '../../initializers' | ||
6 | import { ACTIVITY_PUB } from '../../initializers/constants' | 5 | import { ACTIVITY_PUB } from '../../initializers/constants' |
7 | import { addActivityData } from '../../lib/activitypub/send/send-add' | 6 | import { addActivityData } from '../../lib/activitypub/send/send-add' |
8 | import { getAnnounceActivityPubUrl } from '../../lib/activitypub/url' | 7 | import { getAnnounceActivityPubUrl } from '../../lib/activitypub/url' |
9 | import { announceActivityData } from '../../lib/index' | 8 | import { announceActivityData } from '../../lib/index' |
10 | import { asyncMiddleware, localAccountValidator } from '../../middlewares' | 9 | import { asyncMiddleware, localAccountValidator } from '../../middlewares' |
11 | import { AccountInstance } from '../../models/account/account-interface' | 10 | import { AccountModel } from '../../models/account/account' |
11 | import { VideoModel } from '../../models/video/video' | ||
12 | 12 | ||
13 | const outboxRouter = express.Router() | 13 | const outboxRouter = express.Router() |
14 | 14 | ||
@@ -26,12 +26,12 @@ export { | |||
26 | // --------------------------------------------------------------------------- | 26 | // --------------------------------------------------------------------------- |
27 | 27 | ||
28 | async function outboxController (req: express.Request, res: express.Response, next: express.NextFunction) { | 28 | async function outboxController (req: express.Request, res: express.Response, next: express.NextFunction) { |
29 | const account: AccountInstance = res.locals.account | 29 | const account: AccountModel = res.locals.account |
30 | 30 | ||
31 | const page = req.query.page || 1 | 31 | const page = req.query.page || 1 |
32 | const { start, count } = pageToStartAndCount(page, ACTIVITY_PUB.COLLECTION_ITEMS_PER_PAGE) | 32 | const { start, count } = pageToStartAndCount(page, ACTIVITY_PUB.COLLECTION_ITEMS_PER_PAGE) |
33 | 33 | ||
34 | const data = await db.Video.listAllAndSharedByAccountForOutbox(account.id, start, count) | 34 | const data = await VideoModel.listAllAndSharedByAccountForOutbox(account.id, start, count) |
35 | const activities: Activity[] = [] | 35 | const activities: Activity[] = [] |
36 | 36 | ||
37 | for (const video of data.data) { | 37 | for (const video of data.data) { |