Skip to content

Commit 04c4a59

Browse files
johanbookJohan Book
and
Johan Book
authored
fix(api): fix journal typo (#648)
Co-authored-by: Johan Book <{ID}+{username}@users.noreply.github.com>
1 parent 58d1c2c commit 04c4a59

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

services/api/src/core/journal/application/handlers/command-handlers/create-journal-entry.handler.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { CommandHandler, ICommandHandler } from "@nestjs/cqrs";
33
import { InjectRepository } from "@nestjs/typeorm";
44
import { Repository } from "typeorm";
55

6+
import { MissingUserIdError } from "src/core/authentication";
67
import { CurrentOrganizationService } from "src/core/organizations";
78
import { CurrentProfileService } from "src/core/profiles";
89
import { redactBinaries } from "src/utils/object.helper";
@@ -32,7 +33,10 @@ export class CreateJournalEntryHandler
3233
await this.currentOrganizationService.fetchCurrentOrganizationId();
3334
profileId = await this.currentProfileService.fetchCurrentProfileId();
3435
} catch (error) {
35-
if (error instanceof NotFoundException) {
36+
if (
37+
error instanceof MissingUserIdError ||
38+
error instanceof NotFoundException
39+
) {
3640
return;
3741
}
3842

services/api/src/core/journal/journal.listener.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class JournalLogger {
1616
private readonly commandBus: CommandBus,
1717
private readonly reflector: Reflector,
1818
) {
19-
this.commandBus.subscribe((command: ICommand) => {
19+
this.commandBus.subscribe(async (command: ICommand) => {
2020
const commandName = command.constructor.name;
2121
const payload = command;
2222

@@ -31,7 +31,7 @@ export class JournalLogger {
3131

3232
this.logger.trace("Writing journal entry", { commandName, payload });
3333

34-
this.commandBus.execute(
34+
await this.commandBus.execute(
3535
map(CreateJournalEntryCommand, {
3636
commandName,
3737
payload,

0 commit comments

Comments
 (0)