🐛 Fix metadata missing author info

This commit is contained in:
2024-08-02 21:38:47 +08:00
parent 03f08f1ff6
commit a696b13837
4 changed files with 8 additions and 14 deletions

View File

@ -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)