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,7 @@
*/
import { Inject, Injectable } from '@nestjs/common';
import { In, IsNull, Not } from 'typeorm';
import { In, Not } from 'typeorm';
import * as Redis from 'ioredis';
import _Ajv from 'ajv';
import { ModuleRef } from '@nestjs/core';
@ -250,11 +250,9 @@ export class UserEntityService implements OnModuleInit {
userId: userId,
});
const id = reads.length > 0 ? Not(In(reads.map(read => read.announcementId))) : undefined;
const count = await this.announcementsRepository.countBy([
{ id, userId: IsNull() },
{ id, userId: userId },
]);
const count = await this.announcementsRepository.countBy(reads.length > 0 ? {
id: Not(In(reads.map(read => read.announcementId))),
} : {});
return count > 0;
}