Skip to content

Commit

Permalink
Add debug logging for updated items in DatabaseService and improve Ob…
Browse files Browse the repository at this point in the history
…jectID equality check
  • Loading branch information
simlarsen committed Dec 3, 2024
1 parent ba4795e commit 8d75128
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Common/Server/Services/DatabaseService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,9 @@ class DatabaseService<TBaseModel extends BaseModel> extends BaseService {
...data,
} as any;

logger.debug("Updated Item");
logger.debug(JSON.stringify(updatedItem, null, 2));

await this.getRepository().save(updatedItem);

// hit workflow.
Expand Down
2 changes: 1 addition & 1 deletion Common/Types/ObjectID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class ObjectID extends DatabaseProperty {
}

public equals(other: ObjectID): boolean {
return this.id.toString() === other.id.toString();
return (this.id?.toString() || "") === (other.id?.toString() || "");
}

public override toString(): string {
Expand Down

0 comments on commit 8d75128

Please sign in to comment.