Skip to content

Commit

Permalink
fix of 1fa1d31
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Oct 16, 2023
1 parent 1fa1d31 commit 24437a0
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
6 changes: 2 additions & 4 deletions packages/backend/src/core/AccountMoveService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class AccountMoveService {
{ muteeId: dst.id, expiresAt: IsNull() },
).then(mutings => mutings.map(muting => muting.muterId));

const newMutings: Map<string, { muterId: string; muteeId: string; createdAt: Date; expiresAt: Date | null; }> = new Map();
const newMutings: Map<string, { muterId: string; muteeId: string; expiresAt: Date | null; }> = new Map();

// 重複しないようにIDを生成
const genId = (): string => {
Expand All @@ -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,
});
}
Expand Down Expand Up @@ -228,7 +227,7 @@ export class AccountMoveService {
},
}).then(memberships => memberships.map(membership => membership.userListId));

const newMemberships: Map<string, { createdAt: Date; userId: string; userListId: string; userListUserId: string; }> = new Map();
const newMemberships: Map<string, { userId: string; userListId: string; userListUserId: string; }> = new Map();

// 重複しないようにIDを生成
const genId = (): string => {
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // 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;
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/server/api/endpoints/admin/show-users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // 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;
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/server/api/endpoints/drive/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // 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;
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/server/api/endpoints/hashtags/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // 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;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/server/api/endpoints/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // 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;
Expand Down

0 comments on commit 24437a0

Please sign in to comment.