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:
Zeng1998 2022-11-05 20:21:13 +08:00 committed by GitHub
parent 78b4733fb9
commit 3aa44f9f6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -222,6 +222,14 @@ func (s *Store) DeleteMemo(ctx context.Context, delete *api.MemoDelete) error {
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 {
return FormatError(err)
}