diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-15 10:10:41 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:51 +0100 |
commit | 51548b31815c6f96f314ae96588a9adca150519d (patch) | |
tree | b3298447b7ac128823016fdec92d083e07d9432e /server/models/account/account-follow-interface.ts | |
parent | 350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad (diff) | |
download | PeerTube-51548b31815c6f96f314ae96588a9adca150519d.tar.gz PeerTube-51548b31815c6f96f314ae96588a9adca150519d.tar.zst PeerTube-51548b31815c6f96f314ae96588a9adca150519d.zip |
Add follow tabs
Following
Follow
Followers
Diffstat (limited to 'server/models/account/account-follow-interface.ts')
-rw-r--r-- | server/models/account/account-follow-interface.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/server/models/account/account-follow-interface.ts b/server/models/account/account-follow-interface.ts index efdff915e..413dad190 100644 --- a/server/models/account/account-follow-interface.ts +++ b/server/models/account/account-follow-interface.ts | |||
@@ -1,13 +1,26 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import * as Bluebird from 'bluebird' | 2 | import * as Bluebird from 'bluebird' |
3 | import { FollowState } from '../../../shared/models/accounts/follow.model' | 3 | import { FollowState } from '../../../shared/models/accounts/follow.model' |
4 | import { ResultList } from '../../../shared/models/result-list.model' | ||
5 | import { AccountInstance } from './account-interface' | ||
4 | 6 | ||
5 | export namespace AccountFollowMethods { | 7 | export namespace AccountFollowMethods { |
6 | export type LoadByAccountAndTarget = (accountId: number, targetAccountId: number) => Bluebird<AccountFollowInstance> | 8 | export type LoadByAccountAndTarget = (accountId: number, targetAccountId: number) => Bluebird<AccountFollowInstance> |
9 | |||
10 | export type ListFollowingForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountInstance> > | ||
11 | export type ListFollowersForApi = (id: number, start: number, count: number, sort: string) => Bluebird< ResultList<AccountInstance> > | ||
12 | |||
13 | export type ListAcceptedFollowerUrlsForApi = (id: number, start: number, count?: number) => Promise< ResultList<string> > | ||
14 | export type ListAcceptedFollowingUrlsForApi = (id: number, start: number, count?: number) => Promise< ResultList<string> > | ||
7 | } | 15 | } |
8 | 16 | ||
9 | export interface AccountFollowClass { | 17 | export interface AccountFollowClass { |
10 | loadByAccountAndTarget: AccountFollowMethods.LoadByAccountAndTarget | 18 | loadByAccountAndTarget: AccountFollowMethods.LoadByAccountAndTarget |
19 | listFollowersForApi: AccountFollowMethods.ListFollowersForApi | ||
20 | listFollowingForApi: AccountFollowMethods.ListFollowingForApi | ||
21 | |||
22 | listAcceptedFollowerUrlsForApi: AccountFollowMethods.ListAcceptedFollowerUrlsForApi | ||
23 | listAcceptedFollowingUrlsForApi: AccountFollowMethods.ListAcceptedFollowingUrlsForApi | ||
11 | } | 24 | } |
12 | 25 | ||
13 | export interface AccountFollowAttributes { | 26 | export interface AccountFollowAttributes { |
@@ -20,6 +33,9 @@ export interface AccountFollowInstance extends AccountFollowClass, AccountFollow | |||
20 | id: number | 33 | id: number |
21 | createdAt: Date | 34 | createdAt: Date |
22 | updatedAt: Date | 35 | updatedAt: Date |
36 | |||
37 | AccountFollower?: AccountInstance | ||
38 | AccountFollowing?: AccountInstance | ||
23 | } | 39 | } |
24 | 40 | ||
25 | export interface AccountFollowModel extends AccountFollowClass, Sequelize.Model<AccountFollowInstance, AccountFollowAttributes> {} | 41 | export interface AccountFollowModel extends AccountFollowClass, Sequelize.Model<AccountFollowInstance, AccountFollowAttributes> {} |