mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-24 14:00:59 +02:00
fix: try to fix gist
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -51,7 +51,10 @@ const AnonymizedGistSchema = new Schema({
|
||||
content: String,
|
||||
language: String,
|
||||
size: Number,
|
||||
type: String,
|
||||
// `type` is a reserved key in Mongoose type declarations; without the
|
||||
// nested `{ type: String }` the whole object is compiled as an array
|
||||
// of strings and file objects are silently dropped on save.
|
||||
type: { type: String },
|
||||
},
|
||||
],
|
||||
comments: [
|
||||
|
||||
Reference in New Issue
Block a user