Skip to content

Commit

Permalink
Merge pull request #18 from fagbokforlaget/fix-proper-place-for-debug…
Browse files Browse the repository at this point in the history
…-option

fix: proper place for the debug option
  • Loading branch information
rawongithub committed Mar 25, 2024
2 parents c9ceb40 + f3bbcc6 commit 76de28d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/message-dispatcher.decorator.ts
Expand Up @@ -12,6 +12,7 @@ export const DispatcherParamsMetadata = 'dispatcher-options';
export interface DispatcherOptions {
action: ((req: any, data: any) => Action) | string;
objectIdGetter: (req: any, data: any) => string | string[];
debug?: boolean;
}

export const MessageEventEmitter = (params: DispatcherOptions) =>
Expand Down
2 changes: 1 addition & 1 deletion src/message-dispatcher.interceptor.ts
Expand Up @@ -60,7 +60,7 @@ export class MessageDispatcherInterceptor implements NestInterceptor {
timestamp: timestamp(),
};

if (this.options.debug) {
if (options.debug) {
this.logger.debug(this.options.subject, JSON.stringify(sendData));
}

Expand Down
1 change: 0 additions & 1 deletion src/options.dto.ts
Expand Up @@ -3,5 +3,4 @@ import { Message } from './message.dto';
export class Options {
subject: string;
messageData: Message;
debug?: boolean;
}

0 comments on commit 76de28d

Please sign in to comment.