Skip to content

Commit

Permalink
admin/delete-instance-usersで一覧の無視リストも見るように
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Feb 20, 2024
1 parent 45456bf commit c646f9d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/server/api/endpoints/admin/delete-instance-users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Message from '../../../../models/messaging-message';
import { doPostSuspend } from '../../../../services/suspend-user';
import { createDeleteNotesJob, createDeleteDriveFilesJob } from '../../../../queue';
import { toDbHost } from '../../../../misc/convert-host';
import Instance from '../../../../models/instance';
import { isBlockedHost, isClosedHost } from '../../../../services/instance-moderation';

export const meta = {
desc: {
Expand Down Expand Up @@ -37,12 +37,7 @@ export const meta = {
export default define(meta, async (ps) => {
const host = toDbHost(ps.host);

const instance = await Instance.findOne({
host
});

if (instance == null) throw 'instance not found';
if (!instance.isBlocked && !instance.isMarkedAsClosed) throw 'instance はブロックでもクローズでもない';
if (!await isBlockedHost(host) && !await isClosedHost(host)) throw new Error('instance はブロックでもクローズでもない');

const users = await User.find({
host,
Expand Down

0 comments on commit c646f9d

Please sign in to comment.