🗑️ Remove account

This commit is contained in:
2024-11-03 01:53:57 +08:00
parent 94b777a3e4
commit 2d119826fe
16 changed files with 57 additions and 91 deletions

View File

@@ -3,6 +3,8 @@ package api
import (
"fmt"
"git.solsynth.dev/hypernet/nexus/pkg/nex/sec"
"git.solsynth.dev/hypernet/paperclip/pkg/internal/gap"
"git.solsynth.dev/hypernet/passport/pkg/authkit"
"strings"
"git.solsynth.dev/hypernet/paperclip/pkg/internal/database"
@@ -41,10 +43,8 @@ func listStickers(c *fiber.Ctx) error {
tx := database.C
if len(c.Query("author")) > 0 {
var author models.Account
if err := database.C.Where("name = ?", c.Query("author")).First(&author).Error; err != nil {
return fiber.NewError(fiber.StatusBadRequest, err.Error())
} else {
author, err := authkit.GetUserByName(gap.Nx, c.Query("author"))
if err == nil {
tx = tx.Where("account_id = ?", author.ID)
}
}