fix(snippet): delete field when update

This commit is contained in:
Innei
2022-01-10 13:46:21 +08:00
parent 23ae8f3fe5
commit e3a182f09e

View File

@@ -29,12 +29,13 @@ export class SnippetService {
async update(id: string, model: SnippetModel) {
await this.validateType(model)
delete model.created
await this.model.updateOne(
{
_id: id,
},
model,
{ ...model },
)
}