mirror of
https://github.com/versia-pub/server.git
synced 2026-01-26 12:16:01 +01:00
fix(api): 🐛 Fix incorrect editing of note attachments (when attachments are removed)
This commit is contained in:
parent
88ad7178bf
commit
3e94a9d491
|
|
@ -373,7 +373,15 @@ export class Note {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set attachment parents
|
// Set attachment parents
|
||||||
if (media_attachments && media_attachments.length > 0) {
|
if (media_attachments) {
|
||||||
|
await db
|
||||||
|
.update(Attachments)
|
||||||
|
.set({
|
||||||
|
noteId: null,
|
||||||
|
})
|
||||||
|
.where(eq(Attachments.noteId, this.status.id));
|
||||||
|
|
||||||
|
if (media_attachments.length > 0)
|
||||||
await db
|
await db
|
||||||
.update(Attachments)
|
.update(Attachments)
|
||||||
.set({
|
.set({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue