summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/NoteEditService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/core/NoteEditService.ts')
-rw-r--r--packages/backend/src/core/NoteEditService.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/backend/src/core/NoteEditService.ts b/packages/backend/src/core/NoteEditService.ts
index acf916983c..1901f2db7d 100644
--- a/packages/backend/src/core/NoteEditService.ts
+++ b/packages/backend/src/core/NoteEditService.ts
@@ -438,7 +438,11 @@ export class NoteEditService implements OnApplicationShutdown {
userHost: user.host,
});
- await transactionalEntityManager.update(MiPoll, oldnote.id, poll);
+ if (!oldnote.hasPoll) {
+ await transactionalEntityManager.insert(MiPoll, poll);
+ } else {
+ await transactionalEntityManager.update(MiPoll, oldnote.id, poll);
+ }
});
} else {
await this.notesRepository.update(oldnote.id, note);