Skip to content

Commit

Permalink
Merge pull request #166 from Hexastack/165-issue-untyped-events-and-e…
Browse files Browse the repository at this point in the history
…vent-listners

165 issue untyped events and event listeners
  • Loading branch information
marrouchi authored Oct 9, 2024
2 parents fde4224 + 8a1efec commit 63a7981
Show file tree
Hide file tree
Showing 12 changed files with 452 additions and 53 deletions.
4 changes: 2 additions & 2 deletions api/src/analytics/services/bot-stats.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class BotStatsService extends BaseService<BotStats> {
* @param {Subscriber} subscriber - The subscriber object that contains last visit and retention data.
*/
@OnEvent('hook:user:lastvisit')
private handleLastVisit(subscriber: Subscriber) {
handleLastVisit(subscriber: Subscriber) {
const now = +new Date();
if (subscriber.lastvisit) {
// A loyal subscriber is a subscriber that comes back after some inactivity
Expand Down Expand Up @@ -110,7 +110,7 @@ export class BotStatsService extends BaseService<BotStats> {
* @param name - The name or identifier of the statistics entry (e.g., a specific feature or component being tracked).
*/
@OnEvent('hook:stats:entry')
private async handleStatEntry(type: BotStatsType, name: string) {
async handleStatEntry(type: BotStatsType, name: string) {
const day = new Date();
day.setMilliseconds(0);
day.setSeconds(0);
Expand Down
2 changes: 1 addition & 1 deletion api/src/chat/services/subscriber.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export class SubscriberService extends BaseService<
* @param subscriber The subscriber whose is being handled.
*/
@OnEvent('hook:user:lastvisit')
private async handleLastVisit(subscriber: Subscriber) {
async handleLastVisit(subscriber: Subscriber) {
if (subscriber.lastvisit) {
try {
const user = await this.updateOne(subscriber.id, {
Expand Down
Loading

0 comments on commit 63a7981

Please sign in to comment.