テーブル分割
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { Feed } from 'feed';
|
||||
import config from '../../config';
|
||||
import { User } from '../../models/entities/user';
|
||||
import { Notes, DriveFiles } from '../../models';
|
||||
import { Notes, DriveFiles, UserProfiles } from '../../models';
|
||||
import { In } from 'typeorm';
|
||||
|
||||
export default async function(user: User) {
|
||||
@ -10,6 +10,8 @@ export default async function(user: User) {
|
||||
name: user.name || user.username
|
||||
};
|
||||
|
||||
const profile = await UserProfiles.findOne({ userId: user.id });
|
||||
|
||||
const notes = await Notes.find({
|
||||
where: {
|
||||
userId: user.id,
|
||||
@ -25,7 +27,7 @@ export default async function(user: User) {
|
||||
title: `${author.name} (@${user.username}@${config.host})`,
|
||||
updated: notes[0].createdAt,
|
||||
generator: 'Misskey',
|
||||
description: `${user.notesCount} Notes, ${user.followingCount} Following, ${user.followersCount} Followers${user.description ? ` · ${user.description}` : ''}`,
|
||||
description: `${user.notesCount} Notes, ${user.followingCount} Following, ${user.followersCount} Followers${profile.description ? ` · ${profile.description}` : ''}`,
|
||||
link: author.link,
|
||||
image: user.avatarUrl,
|
||||
feedLinks: {
|
||||
|
Reference in New Issue
Block a user