Skip to content

Commit

Permalink
fix: manual activity addition for custom platform types (#2050)
Browse files Browse the repository at this point in the history
  • Loading branch information
skwowet authored Jan 9, 2024
1 parent 7b57dd3 commit 0809247
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/src/services/activityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ export default class ActivityService extends LoggerBase {
data.sentiment = sentiment
}

if (!data.username && data.platform === PlatformType.OTHER) {
if (
!data.username &&
(data.platform === PlatformType.OTHER ||
// we have some custom platform types in db that are not in enum
!Object.values(PlatformType).includes(data.platform))
) {
const { displayName } = await MemberRepository.findById(data.member, repositoryOptions)
// Get the first key of the username object as a string
data.username = displayName
Expand Down

0 comments on commit 0809247

Please sign in to comment.