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

@ -4,7 +4,6 @@
*/
import { Inject, Injectable } from '@nestjs/common';
import { IsNull } from 'typeorm';
import { Endpoint } from '@/server/api/endpoint-base.js';
import { IdService } from '@/core/IdService.js';
import type { AnnouncementReadsRepository, AnnouncementsRepository } from '@/models/index.js';
@ -53,18 +52,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
) {
super(meta, paramDef, async (ps, me) => {
// Check if announcement exists
const announcementExist = await this.announcementsRepository.exist({
where: [
{
id: ps.announcementId,
userId: IsNull(),
},
{
id: ps.announcementId,
userId: me.id,
}
]
});
const announcementExist = await this.announcementsRepository.exist({ where: { id: ps.announcementId } });
if (!announcementExist) {
throw new ApiError(meta.errors.noSuchAnnouncement);