Skip to content

Commit

Permalink
fix:change-notif-message (#823)
Browse files Browse the repository at this point in the history
* update notif enum

* vote dan notif service

* fix notif and vote

* Update notification.service.ts

* Update vote.service.ts

* Update database.helper.ts

* format fix

* update vote.service.ts

* fix-notif

* change message

---------

Co-authored-by: RiXelanya <>
  • Loading branch information
RiXelanya committed Mar 28, 2023
1 parent b58bef8 commit 4d4622e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/services/notification.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export class NotificationService {
async sendVoteCount(
referencetype: ReferenceType,
referenceID: string,
upvotes: number,
): Promise<void> {
const destination: string = await (referencetype === ReferenceType.POST
? this.postRepository
Expand All @@ -166,7 +167,7 @@ export class NotificationService {
const notification = new Notification({
type: NotificationType.VOTE_COUNT,
referenceId: referenceID,
message: 'Your post is getting upvotes',
message: upvotes.toString(),
from: MyriadUserID,
});
const title = 'New Upvotes';
Expand Down
2 changes: 1 addition & 1 deletion src/services/vote.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class VoteService {
this.metricService.publicMetric(type, referenceId).then(metric => {
if (this.upvoteCounter(metric.upvotes)) {
this.notificationService
.sendVoteCount(type, referenceId)
.sendVoteCount(type, referenceId, metric.upvotes)
.catch((err: Error) => {
throw err;
});
Expand Down

0 comments on commit 4d4622e

Please sign in to comment.