Resolve #1669
This commit is contained in:
@ -137,87 +137,10 @@ export class UserProfile {
|
||||
@JoinColumn()
|
||||
public pinnedPage: Page | null;
|
||||
|
||||
//#region Linking
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
@Column('jsonb', {
|
||||
default: {}
|
||||
})
|
||||
public twitter: boolean;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
})
|
||||
public twitterAccessToken: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
})
|
||||
public twitterAccessTokenSecret: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
})
|
||||
public twitterUserId: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
})
|
||||
public twitterScreenName: string | null;
|
||||
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
})
|
||||
public github: boolean;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
})
|
||||
public githubAccessToken: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
})
|
||||
public githubId: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
})
|
||||
public githubLogin: string | null;
|
||||
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
})
|
||||
public discord: boolean;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
})
|
||||
public discordAccessToken: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
})
|
||||
public discordRefreshToken: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
})
|
||||
public discordExpiresDate: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
})
|
||||
public discordId: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
})
|
||||
public discordUsername: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 64, nullable: true, default: null,
|
||||
})
|
||||
public discordDiscriminator: string | null;
|
||||
//#endregion
|
||||
public integrations: Record<string, any>;
|
||||
|
||||
//#region Denormalized fields
|
||||
@Index()
|
||||
|
@ -213,19 +213,6 @@ export class UserRepository extends Repository<User> {
|
||||
userId: user.id
|
||||
}).then(result => result >= 1)
|
||||
: false,
|
||||
twitter: profile!.twitter ? {
|
||||
id: profile!.twitterUserId,
|
||||
screenName: profile!.twitterScreenName
|
||||
} : null,
|
||||
github: profile!.github ? {
|
||||
id: profile!.githubId,
|
||||
login: profile!.githubLogin
|
||||
} : null,
|
||||
discord: profile!.discord ? {
|
||||
id: profile!.discordId,
|
||||
username: profile!.discordUsername,
|
||||
discriminator: profile!.discordDiscriminator
|
||||
} : null,
|
||||
} : {}),
|
||||
|
||||
...(opts.detail && meId === user.id ? {
|
||||
@ -242,6 +229,7 @@ export class UserRepository extends Repository<User> {
|
||||
pendingReceivedFollowRequestsCount: FollowRequests.count({
|
||||
followeeId: user.id
|
||||
}),
|
||||
integrations: profile?.integrations,
|
||||
} : {}),
|
||||
|
||||
...(opts.includeSecrets ? {
|
||||
|
Reference in New Issue
Block a user