|
|
@@ -1956,7 +1956,7 @@ func updateAttachments(item interface{}, files []string) error { |
|
|
|
case *models.Comment: |
|
|
|
attachments = content.Attachments |
|
|
|
default: |
|
|
|
return fmt.Errorf("Unknow Type") |
|
|
|
return fmt.Errorf("Unknown Type: %T", content) |
|
|
|
} |
|
|
|
for i := 0; i < len(attachments); i++ { |
|
|
|
if util.IsStringInSlice(attachments[i].UUID, files) { |
|
|
@@ -1974,7 +1974,7 @@ func updateAttachments(item interface{}, files []string) error { |
|
|
|
case *models.Comment: |
|
|
|
err = content.UpdateAttachments(files) |
|
|
|
default: |
|
|
|
return fmt.Errorf("Unknow Type") |
|
|
|
return fmt.Errorf("Unknown Type: %T", content) |
|
|
|
} |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
@@ -1986,7 +1986,7 @@ func updateAttachments(item interface{}, files []string) error { |
|
|
|
case *models.Comment: |
|
|
|
content.Attachments, err = models.GetAttachmentsByCommentID(content.ID) |
|
|
|
default: |
|
|
|
return fmt.Errorf("Unknow Type") |
|
|
|
return fmt.Errorf("Unknown Type: %T", content) |
|
|
|
} |
|
|
|
return err |
|
|
|
} |