- commit
- 41ea5a7
- parent
- cad59bf
- author
- Eric Bower
- date
- 2023-01-05 02:41:44 +0000 UTC
fix(imgs): allow deletion using the empty post method
1 files changed,
+6,
-0
+6,
-0
1@@ -39,6 +39,12 @@ func (h *UploadImgHandler) validateImg(data *PostMetaData) (bool, error) {
2 }
3
4 func (h *UploadImgHandler) metaImg(data *PostMetaData) error {
5+ // if the file is empty that means we should delete it
6+ // so we can skip all the meta info
7+ if data.FileSize == 0 {
8+ return nil
9+ }
10+
11 bucket, err := h.Storage.UpsertBucket(data.User.ID)
12 if err != nil {
13 return err