diff options
| author | Mar0xy <marie@kaifa.ch> | 2023-10-06 21:12:33 +0200 |
|---|---|---|
| committer | Mar0xy <marie@kaifa.ch> | 2023-10-06 21:12:33 +0200 |
| commit | 9a96ac02fcc6b0d49a4123f585434ce0bf19766e (patch) | |
| tree | a1fb68b66ded9f367667db1e3e83f314815a70c8 /packages/backend/src/core/NoteEditService.ts | |
| parent | upd: federate listenbrainz, fix background federation (diff) | |
| download | sharkey-9a96ac02fcc6b0d49a4123f585434ce0bf19766e.tar.gz sharkey-9a96ac02fcc6b0d49a4123f585434ce0bf19766e.tar.bz2 sharkey-9a96ac02fcc6b0d49a4123f585434ce0bf19766e.zip | |
fix: adding poll to note during edit breakage
Diffstat (limited to 'packages/backend/src/core/NoteEditService.ts')
| -rw-r--r-- | packages/backend/src/core/NoteEditService.ts | 6 |
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); |