fix(server): deal with unexpected updates (#4064)

This commit is contained in:
liuyi
2023-08-31 16:56:33 +08:00
committed by GitHub
parent 9bffe3cf24
commit e10868cd20
3 changed files with 26 additions and 10 deletions
@@ -326,13 +326,15 @@ export class WorkspaceResolver {
},
});
await this.prisma.snapshot.create({
data: {
id: workspace.id,
workspaceId: workspace.id,
blob: buffer,
},
});
if (buffer.length) {
await this.prisma.snapshot.create({
data: {
id: workspace.id,
workspaceId: workspace.id,
blob: buffer,
},
});
}
return workspace;
}