mirror of
https://github.com/usememos/memos.git
synced 2024-12-21 02:01:55 +03:00
fix: delete related resources (#415)
* chore: add icon * fix: delete all related resources when a memo is deleted * update Co-authored-by: boojack <stevenlgtm@gmail.com>
This commit is contained in:
parent
78b4733fb9
commit
3aa44f9f6d
@ -222,6 +222,14 @@ func (s *Store) DeleteMemo(ctx context.Context, delete *api.MemoDelete) error {
|
|||||||
return FormatError(err)
|
return FormatError(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resourceDelete := &api.MemoResourceDelete{
|
||||||
|
MemoID: delete.ID,
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := deleteMemoResource(ctx, tx, resourceDelete); err != nil {
|
||||||
|
return FormatError(err)
|
||||||
|
}
|
||||||
|
|
||||||
if err := tx.Commit(); err != nil {
|
if err := tx.Commit(); err != nil {
|
||||||
return FormatError(err)
|
return FormatError(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user