fix: try to fix gist

This commit is contained in:
tdurieux
2026-07-02 14:53:26 +03:00
parent 839582c657
commit 1c1993f972
3 changed files with 71 additions and 4 deletions
-3
View File
@@ -114,9 +114,6 @@ export default class Gist {
comments: commentsMapped,
};
this._gistPayload = payload;
// `gist` is a nested path (not a sub-schema), so assigning the whole
// object via set("gist", payload) mis-casts the inner subdoc arrays.
// Set each sub-path individually so Mongoose casts arrays correctly.
this._model.set("gist.description", payload.description);
this._model.set("gist.isPublic", payload.isPublic);
this._model.set("gist.creationDate", payload.creationDate);