perf: 通知选择器优化

This commit is contained in:
xiaojunnuo
2024-12-02 14:06:55 +08:00
parent 68a503796c
commit 2c0cbdd29e
11 changed files with 274 additions and 150 deletions

View File

@@ -140,4 +140,17 @@ export class NotificationController extends CrudController<NotificationService>
const res = await this.service.setDefault(id, this.getUserId());
return this.ok(res);
}
@Post('/options', { summary: Constants.per.authOnly })
async options() {
const res = await this.service.list({
query: {
userId: this.getUserId(),
},
});
for (const item of res) {
delete item.setting;
}
return this.ok(res);
}
}