From 068b434b37134c4fc72c0d27014972df91ffad6e Mon Sep 17 00:00:00 2001 From: Kristofer Date: Fri, 18 Aug 2023 11:56:28 +0200 Subject: [PATCH 1/2] Changes what is logged when new praise are created. --- packages/api/src/praise/praise.controller.ts | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/packages/api/src/praise/praise.controller.ts b/packages/api/src/praise/praise.controller.ts index 7291f7fe9..179790a2c 100644 --- a/packages/api/src/praise/praise.controller.ts +++ b/packages/api/src/praise/praise.controller.ts @@ -247,22 +247,14 @@ export class PraiseController { ): Promise { const praise = await this.praiseService.createPraiseItem(data); - let giver: string; - const praiseItem = praise[0]; - if (praiseItem.giver && praiseItem.giver instanceof UserAccount) { - if (praiseItem.giver.user && praiseItem.giver.user instanceof User) { - giver = praiseItem.giver.user.username; - } else { - giver = String(praiseItem.giver._id); - } - } else { - giver = String(praiseItem.giver); - } - await this.eventLogService.logEventWithAuthContext({ authContext: request.authContext, typeKey: EventLogTypeKey.PRAISE, - description: `Giver ${giver} created an Praise item with receiver IDS ${data.receiverIds}`, + description: `User ${data.giver.name}, accountId: ${ + data.giver.accountId + }, created praise items: ${praise.map((p) => p._id)}, platform: ${ + data.giver.platform + }`, }); return praise; From 1b0144d5ef5af9d40fb5070a17b3bbb6c53f106d Mon Sep 17 00:00:00 2001 From: Kristofer Date: Fri, 18 Aug 2023 11:58:56 +0200 Subject: [PATCH 2/2] CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4fcc5df3..a9500b7d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- **API:** Decreased the amount of information logged when praising. Full praise is available in praise feed, now logging user id and praise ids only. - **Frontend**: User pages can now be accessed with the username instead of the user id. #1128 - **Frontend**: Upgraded to the latest version of RainbowKit. This should fix some issues with the WalletConnect login flow. - **API**: Backup restore script now supports specifying which database to import from and restore to