Skip to content

Commit

Permalink
fix: fix entity error
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemajesty committed Jul 1, 2023
1 parent 43e5c78 commit b1539eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/entity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { v4 as uuidv4 } from 'uuid';

export const withID = (entity: IEntity & { _id?: string }): unknown => {
export const withID = (entity: { _id?: string; id?: string }): unknown => {
entity.id = [entity?.id, entity?._id, uuidv4()].find(Boolean);
return entity;
};
Expand Down

0 comments on commit b1539eb

Please sign in to comment.