From 24437a04d49bb720ac632959270e072f072707c6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 16 Oct 2023 12:00:56 +0900 Subject: [PATCH] fix of 1fa1d31696 --- packages/backend/src/core/AccountMoveService.ts | 6 ++---- .../backend/src/server/api/endpoints/admin/invite/list.ts | 4 ++-- .../backend/src/server/api/endpoints/admin/show-users.ts | 4 ++-- packages/backend/src/server/api/endpoints/drive/files.ts | 4 ++-- packages/backend/src/server/api/endpoints/hashtags/users.ts | 4 ++-- packages/backend/src/server/api/endpoints/users.ts | 4 ++-- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/packages/backend/src/core/AccountMoveService.ts b/packages/backend/src/core/AccountMoveService.ts index ed2891113b..350aa6ba24 100644 --- a/packages/backend/src/core/AccountMoveService.ts +++ b/packages/backend/src/core/AccountMoveService.ts @@ -180,7 +180,7 @@ export class AccountMoveService { { muteeId: dst.id, expiresAt: IsNull() }, ).then(mutings => mutings.map(muting => muting.muterId)); - const newMutings: Map = new Map(); + const newMutings: Map = new Map(); // 重複しないようにIDを生成 const genId = (): string => { @@ -194,7 +194,6 @@ export class AccountMoveService { if (existingMutingsMuterUserIds.includes(muting.muterId)) continue; // skip if already muted indefinitely newMutings.set(genId(), { ...muting, - createdAt: new Date(), muteeId: dst.id, }); } @@ -228,7 +227,7 @@ export class AccountMoveService { }, }).then(memberships => memberships.map(membership => membership.userListId)); - const newMemberships: Map = new Map(); + const newMemberships: Map = new Map(); // 重複しないようにIDを生成 const genId = (): string => { @@ -241,7 +240,6 @@ export class AccountMoveService { for (const membership of oldMemberships) { if (existingUserListIds.includes(membership.userListId)) continue; // skip if dst exists in this user's list newMemberships.set(genId(), { - createdAt: new Date(), userId: dst.id, userListId: membership.userListId, userListUserId: membership.userListUserId, diff --git a/packages/backend/src/server/api/endpoints/admin/invite/list.ts b/packages/backend/src/server/api/endpoints/admin/invite/list.ts index a20a51121a..f25d3fcb33 100644 --- a/packages/backend/src/server/api/endpoints/admin/invite/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/invite/list.ts @@ -56,8 +56,8 @@ export default class extends Endpoint { // eslint- } switch (ps.sort) { - case '+createdAt': query.orderBy('ticket.createdAt', 'DESC'); break; - case '-createdAt': query.orderBy('ticket.createdAt', 'ASC'); break; + case '+createdAt': query.orderBy('ticket.id', 'DESC'); break; + case '-createdAt': query.orderBy('ticket.id', 'ASC'); break; case '+usedAt': query.orderBy('ticket.usedAt', 'DESC', 'NULLS LAST'); break; case '-usedAt': query.orderBy('ticket.usedAt', 'ASC', 'NULLS FIRST'); break; default: query.orderBy('ticket.id', 'DESC'); break; diff --git a/packages/backend/src/server/api/endpoints/admin/show-users.ts b/packages/backend/src/server/api/endpoints/admin/show-users.ts index e89e1a1490..fc810987d2 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-users.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-users.ts @@ -99,8 +99,8 @@ export default class extends Endpoint { // eslint- switch (ps.sort) { case '+follower': query.orderBy('user.followersCount', 'DESC'); break; case '-follower': query.orderBy('user.followersCount', 'ASC'); break; - case '+createdAt': query.orderBy('user.createdAt', 'DESC'); break; - case '-createdAt': query.orderBy('user.createdAt', 'ASC'); break; + case '+createdAt': query.orderBy('user.id', 'DESC'); break; + case '-createdAt': query.orderBy('user.id', 'ASC'); break; case '+updatedAt': query.orderBy('user.updatedAt', 'DESC', 'NULLS LAST'); break; case '-updatedAt': query.orderBy('user.updatedAt', 'ASC', 'NULLS FIRST'); break; case '+lastActiveDate': query.orderBy('user.lastActiveDate', 'DESC', 'NULLS LAST'); break; diff --git a/packages/backend/src/server/api/endpoints/drive/files.ts b/packages/backend/src/server/api/endpoints/drive/files.ts index 6f3a62977f..b7e9d12e94 100644 --- a/packages/backend/src/server/api/endpoints/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/drive/files.ts @@ -69,8 +69,8 @@ export default class extends Endpoint { // eslint- } switch (ps.sort) { - case '+createdAt': query.orderBy('file.createdAt', 'DESC'); break; - case '-createdAt': query.orderBy('file.createdAt', 'ASC'); break; + case '+createdAt': query.orderBy('file.id', 'DESC'); break; + case '-createdAt': query.orderBy('file.id', 'ASC'); break; case '+name': query.orderBy('file.name', 'DESC'); break; case '-name': query.orderBy('file.name', 'ASC'); break; case '+size': query.orderBy('file.size', 'DESC'); break; diff --git a/packages/backend/src/server/api/endpoints/hashtags/users.ts b/packages/backend/src/server/api/endpoints/hashtags/users.ts index 1cef76d3d2..50aea79943 100644 --- a/packages/backend/src/server/api/endpoints/hashtags/users.ts +++ b/packages/backend/src/server/api/endpoints/hashtags/users.ts @@ -66,8 +66,8 @@ export default class extends Endpoint { // eslint- switch (ps.sort) { case '+follower': query.orderBy('user.followersCount', 'DESC'); break; case '-follower': query.orderBy('user.followersCount', 'ASC'); break; - case '+createdAt': query.orderBy('user.createdAt', 'DESC'); break; - case '-createdAt': query.orderBy('user.createdAt', 'ASC'); break; + case '+createdAt': query.orderBy('user.id', 'DESC'); break; + case '-createdAt': query.orderBy('user.id', 'ASC'); break; case '+updatedAt': query.orderBy('user.updatedAt', 'DESC'); break; case '-updatedAt': query.orderBy('user.updatedAt', 'ASC'); break; } diff --git a/packages/backend/src/server/api/endpoints/users.ts b/packages/backend/src/server/api/endpoints/users.ts index 21c585f1ad..8dc5841314 100644 --- a/packages/backend/src/server/api/endpoints/users.ts +++ b/packages/backend/src/server/api/endpoints/users.ts @@ -74,8 +74,8 @@ export default class extends Endpoint { // eslint- switch (ps.sort) { case '+follower': query.orderBy('user.followersCount', 'DESC'); break; case '-follower': query.orderBy('user.followersCount', 'ASC'); break; - case '+createdAt': query.orderBy('user.createdAt', 'DESC'); break; - case '-createdAt': query.orderBy('user.createdAt', 'ASC'); break; + case '+createdAt': query.orderBy('user.id', 'DESC'); break; + case '-createdAt': query.orderBy('user.id', 'ASC'); break; case '+updatedAt': query.andWhere('user.updatedAt IS NOT NULL').orderBy('user.updatedAt', 'DESC'); break; case '-updatedAt': query.andWhere('user.updatedAt IS NOT NULL').orderBy('user.updatedAt', 'ASC'); break; default: query.orderBy('user.id', 'ASC'); break;