Commit 242fd59
fix(models): call setUpdatedAt for all docs in insertMany
insertMany() only called setUpdatedAt() when a document already had a
valid _id. Documents without _id (the common case) got an _id generated
but skipped setUpdatedAt(), leaving them without _updatedAt in the
database. This caused API response validation failures for endpoints
using $ref schemas that require _updatedAt (e.g. subscriptions.getOne).
Align insertMany() with insertOne(), which already calls setUpdatedAt()
unconditionally.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>1 parent 2e6441e commit 242fd59
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| |||
0 commit comments