mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 03:53:08 +02:00
fix of 1fa1d31696
This commit is contained in:
parent
1fa1d31696
commit
24437a04d4
6 changed files with 12 additions and 14 deletions
|
@ -180,7 +180,7 @@ export class AccountMoveService {
|
||||||
{ muteeId: dst.id, expiresAt: IsNull() },
|
{ muteeId: dst.id, expiresAt: IsNull() },
|
||||||
).then(mutings => mutings.map(muting => muting.muterId));
|
).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を生成
|
// 重複しないようにIDを生成
|
||||||
const genId = (): string => {
|
const genId = (): string => {
|
||||||
|
@ -194,7 +194,6 @@ export class AccountMoveService {
|
||||||
if (existingMutingsMuterUserIds.includes(muting.muterId)) continue; // skip if already muted indefinitely
|
if (existingMutingsMuterUserIds.includes(muting.muterId)) continue; // skip if already muted indefinitely
|
||||||
newMutings.set(genId(), {
|
newMutings.set(genId(), {
|
||||||
...muting,
|
...muting,
|
||||||
createdAt: new Date(),
|
|
||||||
muteeId: dst.id,
|
muteeId: dst.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -228,7 +227,7 @@ export class AccountMoveService {
|
||||||
},
|
},
|
||||||
}).then(memberships => memberships.map(membership => membership.userListId));
|
}).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を生成
|
// 重複しないようにIDを生成
|
||||||
const genId = (): string => {
|
const genId = (): string => {
|
||||||
|
@ -241,7 +240,6 @@ export class AccountMoveService {
|
||||||
for (const membership of oldMemberships) {
|
for (const membership of oldMemberships) {
|
||||||
if (existingUserListIds.includes(membership.userListId)) continue; // skip if dst exists in this user's list
|
if (existingUserListIds.includes(membership.userListId)) continue; // skip if dst exists in this user's list
|
||||||
newMemberships.set(genId(), {
|
newMemberships.set(genId(), {
|
||||||
createdAt: new Date(),
|
|
||||||
userId: dst.id,
|
userId: dst.id,
|
||||||
userListId: membership.userListId,
|
userListId: membership.userListId,
|
||||||
userListUserId: membership.userListUserId,
|
userListUserId: membership.userListUserId,
|
||||||
|
|
|
@ -56,8 +56,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (ps.sort) {
|
switch (ps.sort) {
|
||||||
case '+createdAt': query.orderBy('ticket.createdAt', 'DESC'); break;
|
case '+createdAt': query.orderBy('ticket.id', 'DESC'); break;
|
||||||
case '-createdAt': query.orderBy('ticket.createdAt', 'ASC'); 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', 'DESC', 'NULLS LAST'); break;
|
||||||
case '-usedAt': query.orderBy('ticket.usedAt', 'ASC', 'NULLS FIRST'); break;
|
case '-usedAt': query.orderBy('ticket.usedAt', 'ASC', 'NULLS FIRST'); break;
|
||||||
default: query.orderBy('ticket.id', 'DESC'); break;
|
default: query.orderBy('ticket.id', 'DESC'); break;
|
||||||
|
|
|
@ -99,8 +99,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
switch (ps.sort) {
|
switch (ps.sort) {
|
||||||
case '+follower': query.orderBy('user.followersCount', 'DESC'); break;
|
case '+follower': query.orderBy('user.followersCount', 'DESC'); break;
|
||||||
case '-follower': query.orderBy('user.followersCount', 'ASC'); break;
|
case '-follower': query.orderBy('user.followersCount', 'ASC'); break;
|
||||||
case '+createdAt': query.orderBy('user.createdAt', 'DESC'); break;
|
case '+createdAt': query.orderBy('user.id', 'DESC'); break;
|
||||||
case '-createdAt': query.orderBy('user.createdAt', 'ASC'); 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', 'DESC', 'NULLS LAST'); break;
|
||||||
case '-updatedAt': query.orderBy('user.updatedAt', 'ASC', 'NULLS FIRST'); break;
|
case '-updatedAt': query.orderBy('user.updatedAt', 'ASC', 'NULLS FIRST'); break;
|
||||||
case '+lastActiveDate': query.orderBy('user.lastActiveDate', 'DESC', 'NULLS LAST'); break;
|
case '+lastActiveDate': query.orderBy('user.lastActiveDate', 'DESC', 'NULLS LAST'); break;
|
||||||
|
|
|
@ -69,8 +69,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (ps.sort) {
|
switch (ps.sort) {
|
||||||
case '+createdAt': query.orderBy('file.createdAt', 'DESC'); break;
|
case '+createdAt': query.orderBy('file.id', 'DESC'); break;
|
||||||
case '-createdAt': query.orderBy('file.createdAt', 'ASC'); break;
|
case '-createdAt': query.orderBy('file.id', 'ASC'); break;
|
||||||
case '+name': query.orderBy('file.name', 'DESC'); break;
|
case '+name': query.orderBy('file.name', 'DESC'); break;
|
||||||
case '-name': query.orderBy('file.name', 'ASC'); break;
|
case '-name': query.orderBy('file.name', 'ASC'); break;
|
||||||
case '+size': query.orderBy('file.size', 'DESC'); break;
|
case '+size': query.orderBy('file.size', 'DESC'); break;
|
||||||
|
|
|
@ -66,8 +66,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
switch (ps.sort) {
|
switch (ps.sort) {
|
||||||
case '+follower': query.orderBy('user.followersCount', 'DESC'); break;
|
case '+follower': query.orderBy('user.followersCount', 'DESC'); break;
|
||||||
case '-follower': query.orderBy('user.followersCount', 'ASC'); break;
|
case '-follower': query.orderBy('user.followersCount', 'ASC'); break;
|
||||||
case '+createdAt': query.orderBy('user.createdAt', 'DESC'); break;
|
case '+createdAt': query.orderBy('user.id', 'DESC'); break;
|
||||||
case '-createdAt': query.orderBy('user.createdAt', 'ASC'); break;
|
case '-createdAt': query.orderBy('user.id', 'ASC'); break;
|
||||||
case '+updatedAt': query.orderBy('user.updatedAt', 'DESC'); break;
|
case '+updatedAt': query.orderBy('user.updatedAt', 'DESC'); break;
|
||||||
case '-updatedAt': query.orderBy('user.updatedAt', 'ASC'); break;
|
case '-updatedAt': query.orderBy('user.updatedAt', 'ASC'); break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,8 +74,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
switch (ps.sort) {
|
switch (ps.sort) {
|
||||||
case '+follower': query.orderBy('user.followersCount', 'DESC'); break;
|
case '+follower': query.orderBy('user.followersCount', 'DESC'); break;
|
||||||
case '-follower': query.orderBy('user.followersCount', 'ASC'); break;
|
case '-follower': query.orderBy('user.followersCount', 'ASC'); break;
|
||||||
case '+createdAt': query.orderBy('user.createdAt', 'DESC'); break;
|
case '+createdAt': query.orderBy('user.id', 'DESC'); break;
|
||||||
case '-createdAt': query.orderBy('user.createdAt', 'ASC'); 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', 'DESC'); break;
|
||||||
case '-updatedAt': query.andWhere('user.updatedAt IS NOT NULL').orderBy('user.updatedAt', 'ASC'); break;
|
case '-updatedAt': query.andWhere('user.updatedAt IS NOT NULL').orderBy('user.updatedAt', 'ASC'); break;
|
||||||
default: query.orderBy('user.id', 'ASC'); break;
|
default: query.orderBy('user.id', 'ASC'); break;
|
||||||
|
|
Loading…
Reference in a new issue