Revert "feat: 個人宛てお知らせ機能 (#107)"

This reverts commit 7b1efd6b97.
This commit is contained in:
まっちゃとーにゅ 2023-08-15 16:45:55 +09:00
parent 04fefb2056
commit 576251200f
No known key found for this signature in database
GPG key ID: 6AFBBF529601C1DB
17 changed files with 18 additions and 324 deletions

View file

@ -53,14 +53,6 @@ export const meta = {
type: 'boolean',
optional: true, nullable: false,
},
isPrivate: {
type: 'boolean',
optional: false, nullable: true,
},
closeDuration: {
type: 'number',
optional: false, nullable: false,
},
},
},
},
@ -73,7 +65,6 @@ export const paramDef = {
withUnreads: { type: 'boolean', default: false },
sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' },
privateOnly: { type: 'boolean', default: false },
},
required: [],
} as const;
@ -91,19 +82,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
private queryService: QueryService,
) {
super(meta, paramDef, async (ps, me) => {
const builder = this.announcementsRepository.createQueryBuilder('announcement');
if (me) {
if (ps.privateOnly) {
builder.where('"userId" = :userId', { userId: me.id });
} else {
builder.where('"userId" IS NULL');
builder.orWhere('"userId" = :userId', { userId: me.id });
}
} else {
builder.where('"userId" IS NULL');
}
const query = this.queryService.makePaginationQuery(this.announcementsRepository.createQueryBuilder('announcement'), ps.sinceId, ps.untilId);
const query = this.queryService.makePaginationQuery(builder, ps.sinceId, ps.untilId);
const announcements = await query.limit(ps.limit).getMany();
if (me) {
@ -120,7 +100,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
...a,
createdAt: a.createdAt.toISOString(),
updatedAt: a.updatedAt?.toISOString() ?? null,
isPrivate: !!a.userId,
}));
});
}