mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-08-05 14:56:18 +00:00
deps(backend): update typeorm to v1 (#17476)
* deps(backend): update typeorm to v1 * fix * fix * attempt to fix test (to be reverted)) * Revert "attempt to fix test (to be reverted))" This reverts commit8adf2a1239. * attempt to fix test * Revert "attempt to fix test" This reverts commit4cf0f5ec9e. * attempt to fix test * fix * fix
This commit is contained in:
@@ -145,7 +145,7 @@ export class ApiServerService {
|
||||
|
||||
fastify.get('/v1/instance/peers', async (request, reply) => {
|
||||
const instances = await this.instancesRepository.find({
|
||||
select: ['host'],
|
||||
select: { host: true },
|
||||
where: {
|
||||
suspensionState: 'none',
|
||||
},
|
||||
|
||||
@@ -41,7 +41,18 @@ export class GetterService {
|
||||
|
||||
@bindThis
|
||||
public async getNoteWithRelations(noteId: MiNote['id']) {
|
||||
const note = await this.notesRepository.findOne({ where: { id: noteId }, relations: ['user', 'reply', 'renote', 'reply.user', 'renote.user'] });
|
||||
const note = await this.notesRepository.findOne({
|
||||
where: { id: noteId },
|
||||
relations: {
|
||||
user: true,
|
||||
reply: {
|
||||
user: true,
|
||||
},
|
||||
renote: {
|
||||
user: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (note == null) {
|
||||
throw new IdentifiableError('9725d0ce-ba28-4dde-95a7-2cbb2c15de24', 'No such note.');
|
||||
|
||||
@@ -50,7 +50,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
super(meta, paramDef, async (ps, me) => {
|
||||
const profile = await this.userProfilesRepository.findOne({
|
||||
where: { email: ps.email },
|
||||
relations: ['user'],
|
||||
relations: { user: true },
|
||||
});
|
||||
|
||||
if (profile == null) {
|
||||
|
||||
@@ -68,7 +68,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
score: 'DESC',
|
||||
},
|
||||
take: 10,
|
||||
relations: ['user'],
|
||||
relations: { user: true },
|
||||
});
|
||||
|
||||
const users = await this.userEntityService.packMany(records.map(r => r.user!), null);
|
||||
|
||||
@@ -57,7 +57,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
where: {
|
||||
userId: user.id,
|
||||
},
|
||||
relations: ['user'],
|
||||
relations: { user: true },
|
||||
});
|
||||
|
||||
if (userProfile == null) {
|
||||
|
||||
@@ -67,7 +67,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||
where: {
|
||||
userId: me.id,
|
||||
},
|
||||
relations: ['user'],
|
||||
relations: { user: true },
|
||||
});
|
||||
|
||||
if (profile == null) {
|
||||
|
||||
@@ -84,7 +84,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
id: -1,
|
||||
},
|
||||
take: 1000,
|
||||
select: ['replyId'],
|
||||
select: { replyId: true },
|
||||
});
|
||||
|
||||
// 投稿が少なかったら中断
|
||||
@@ -97,7 +97,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
where: {
|
||||
id: In(recentNotes.map(p => p.replyId)),
|
||||
},
|
||||
select: ['userId'],
|
||||
select: { userId: true },
|
||||
});
|
||||
|
||||
const repliedUsers: any = {};
|
||||
@@ -124,7 +124,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
const _userMap = await this.userEntityService.packMany(topRepliedUserIds, me, { schema: 'UserDetailed' })
|
||||
.then(users => new Map(users.map(u => [u.id, u])));
|
||||
const repliesObj = await Promise.all(topRepliedUserIds.map(async (userId) => ({
|
||||
user: _userMap.get(userId) ?? await this.userEntityService.pack(userId, me, { schema: 'UserDetailed' }),
|
||||
user: _userMap.get(userId) ?? (await this.userEntityService.pack(userId, me, { schema: 'UserDetailed' })),
|
||||
weight: repliedUsers[userId] / peak,
|
||||
})));
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ export class UserListChannel extends Channel {
|
||||
where: {
|
||||
userListId: this.listId,
|
||||
},
|
||||
select: ['userId'],
|
||||
select: { userId: true },
|
||||
});
|
||||
|
||||
const membershipsMap: Record<string, Pick<MiUserListMembership, 'withReplies'> | undefined> = {};
|
||||
|
||||
Reference in New Issue
Block a user