diff --git a/routers/api/v1/picture/picture.go b/routers/api/v1/picture/picture.go index 6d3357d..931b1dd 100644 --- a/routers/api/v1/picture/picture.go +++ b/routers/api/v1/picture/picture.go @@ -2,16 +2,13 @@ package picture import ( "bytes" - "fmt" "io" - "strings" "git.umbach.dev/app-idea/rest-api/modules/config" "git.umbach.dev/app-idea/rest-api/modules/rabbitmq" "git.umbach.dev/app-idea/rest-api/modules/structs" "git.umbach.dev/app-idea/rest-api/routers/api/v1/user" "github.com/gofiber/fiber/v2" - "github.com/google/uuid" log "github.com/sirupsen/logrus" ) @@ -56,22 +53,5 @@ func Test(c *fiber.Ctx) error { rabbitmq.PublishPicture(structs.RabbitmqPictureMessage{Picture: buf.Bytes(), UserId: user.Id, Filename: file.Filename}) - filename := strings.Replace(uuid.New().String(), "-", "", -1) - fileExt := strings.Split(file.Filename, ".")[1] - image := fmt.Sprintf("%s.%s", filename, fileExt) - - err = c.SaveFile(file, "./img/"+image) - - if err != nil { - log.Infoln("err2", err) - return c.SendStatus(fiber.StatusInternalServerError) - } - - if err != nil { - log.Infoln("err fileUpload:", err) - } - - log.Infoln("no error") - - return c.SendStatus(fiber.StatusCreated) + return c.SendStatus(fiber.StatusOK) }