From 6cd7bddc37da8b0d7b9860fd9a26ddfe84c869a7 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Wed, 26 Mar 2025 12:06:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=8B=BE=E9=80=89=E9=BB=98=E8=AE=A4=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=87=BA=E7=8E=B0=E5=A4=9A=E4=B8=AA=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E9=80=9A=E7=9F=A5=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pipeline/service/notification-service.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/ui/certd-server/src/modules/pipeline/service/notification-service.ts b/packages/ui/certd-server/src/modules/pipeline/service/notification-service.ts index 24c72cb3..72ccaf1b 100644 --- a/packages/ui/certd-server/src/modules/pipeline/service/notification-service.ts +++ b/packages/ui/certd-server/src/modules/pipeline/service/notification-service.ts @@ -45,6 +45,23 @@ export class NotificationService extends BaseService { return notificationRegistry.getDefine(type); } + async add(bean: NotificationEntity) { + const res = await super.add(bean); + if(bean.isDefault){ + await this.setDefault(res.id, bean.userId); + } + return res + } + + async update(bean: NotificationEntity) { + const res = await super.update(bean); + if(bean.isDefault){ + const old = await this.info(bean.id); + await this.setDefault(bean.id, old.userId); + } + return res + } + async getById(id: number, userId: number): Promise { if (!id) { throw new ValidateException('id不能为空');