mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-01-23 08:26:51 +00:00
Fix deletion of media hyphae with no text
This commit is contained in:
parent
72a3e20ee7
commit
ce6447fea4
@ -18,7 +18,11 @@ func Delete(u *user.User, h hyphae.ExistingHypha) error {
|
|||||||
originalText, _ := FetchTextFile(h)
|
originalText, _ := FetchTextFile(h)
|
||||||
switch h := h.(type) {
|
switch h := h.(type) {
|
||||||
case *hyphae.MediaHypha:
|
case *hyphae.MediaHypha:
|
||||||
|
if h.HasTextFile() {
|
||||||
hop.WithFilesRemoved(h.MediaFilePath(), h.TextFilePath())
|
hop.WithFilesRemoved(h.MediaFilePath(), h.TextFilePath())
|
||||||
|
} else {
|
||||||
|
hop.WithFilesRemoved(h.MediaFilePath())
|
||||||
|
}
|
||||||
case *hyphae.TextualHypha:
|
case *hyphae.TextualHypha:
|
||||||
hop.WithFilesRemoved(h.TextFilePath())
|
hop.WithFilesRemoved(h.TextFilePath())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user