diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index d3a3de4..8105660 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,7 @@
-
-
-
+
@@ -45,7 +43,7 @@
"RunOnceActivity.go.migrated.go.modules.settings": "true",
"RunOnceActivity.go.modules.automatic.dependencies.download": "true",
"RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true",
- "git-widget-placeholder": "features/calc-in-backend",
+ "git-widget-placeholder": "master",
"go.import.settings.migrated": "true",
"go.sdk.automatically.set": "true",
"last_opened_file_path": "/Users/littlesheep/Documents/Projects/Hydrogen/Paperclip/pkg/internal/grpc",
diff --git a/pkg/internal/server/api/attachments_api.go b/pkg/internal/server/api/attachments_api.go
index 659b444..eba0f84 100644
--- a/pkg/internal/server/api/attachments_api.go
+++ b/pkg/internal/server/api/attachments_api.go
@@ -80,11 +80,11 @@ func getAttachmentMeta(c *fiber.Ctx) error {
}
func createAttachment(c *fiber.Ctx) error {
- var user *models.Account
+ var user models.Account
if err := gap.H.EnsureAuthenticated(c); err != nil {
return err
}
- user = lo.ToPtr(c.Locals("user").(models.Account))
+ user = c.Locals("user").(models.Account)
usage := c.FormValue("usage")
if !lo.Contains(viper.GetStringSlice("accepts_usage"), usage) {
@@ -126,6 +126,7 @@ func createAttachment(c *fiber.Ctx) error {
tx.Commit()
+ metadata.Account = user
services.PublishAnalyzeTask(metadata)
return c.JSON(metadata)
diff --git a/pkg/internal/services/attachments.go b/pkg/internal/services/attachments.go
index 2f8d19a..f584fc8 100644
--- a/pkg/internal/services/attachments.go
+++ b/pkg/internal/services/attachments.go
@@ -48,7 +48,7 @@ func GetAttachmentByHash(hash string) (models.Attachment, error) {
return attachment, nil
}
-func NewAttachmentMetadata(tx *gorm.DB, user *models.Account, file *multipart.FileHeader, attachment models.Attachment) (models.Attachment, error) {
+func NewAttachmentMetadata(tx *gorm.DB, user models.Account, file *multipart.FileHeader, attachment models.Attachment) (models.Attachment, error) {
attachment.Uuid = uuid.NewString()
attachment.Size = file.Size
attachment.Name = file.Filename
diff --git a/settings.toml b/settings.toml
index 1ca9999..1bb55ee 100644
--- a/settings.toml
+++ b/settings.toml
@@ -33,10 +33,5 @@ type = "local"
path = "uploads"
[destinations.permanent]
-type = "s3"
-bucket = "bucket"
-endpoint = "s3.ap-east-1.amazonaws.com"
-secret_id = "secret"
-secret_key = "secret"
-access_baseurl = "https://raw.sn.solsynth.dev"
-enable_ssl = true
+type = "local"
+path = "uploads/permanent"