Skip to content

Commit

Permalink
Feature/2.2.1 (#63)
Browse files Browse the repository at this point in the history
* Bug fixed in typing: metadata

* 2.2.1
  • Loading branch information
Jacob Dharandas Méndez authored Jun 4, 2021
1 parent 2ccc6dc commit fce2a2a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nestjs-geteventstore",
"version": "2.2.0",
"version": "2.2.1",
"description": "Event Store connector for NestJS-Cqrs",
"author": "Vincent Vermersch <vincent.vermersch@prestashop.com >",
"contributors": [
Expand Down
2 changes: 1 addition & 1 deletion src/dto/write-event.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class WriteEventDto {

@ValidateNested()
@Type(() => EventMetadataDto)
metadata: EventMetadataDto;
metadata: Partial<EventMetadataDto>; // we add partial to allow metadata auto-generation

@ValidateNested()
data: any;
Expand Down
2 changes: 1 addition & 1 deletion src/events/event-store.event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export abstract class EventStoreEvent
constructor(public data: any, options?: EventOptionsType) {
super();
// metadata is added automatically in write events, so we cast to any
this.metadata = options?.metadata || ({} as any);
this.metadata = options?.metadata || {};
this.eventId = options?.eventId || v4();
this.eventType = options?.eventType || this.constructor.name;
this.eventStreamId = options?.eventStreamId ?? undefined;
Expand Down

0 comments on commit fce2a2a

Please sign in to comment.