Skip to content

Commit

Permalink
fix(refrence): set created meta to now
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm committed Apr 20, 2024
1 parent b282b9b commit 9cacc0f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/reference/src/collection-reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,16 @@ export class CollectionReference<TItem extends JsonifiableObject = JsonifiableOb
this.logger__.accident('create', 'collection_item_exist', {id});
throw new Error('collection_item_exist', {cause: {id}});
}

const now = Date.now();

this.context__.data[id] = {
meta: {
id,
// other prop calc in updateMeta__
rev: 0,
created: 0,
updated: 0,
created: now,
updated: now,
},
data,
};
Expand Down

0 comments on commit 9cacc0f

Please sign in to comment.