snow/handlers/storefront.go
eccentric e57a2f23d6 Working Multi-Season Storefront
Season 14+ have proper display assets
2023-12-03 02:02:19 +00:00

27 lines
708 B
Go

package handlers
import (
"github.com/goccy/go-json"
"github.com/ectrc/snow/aid"
"github.com/ectrc/snow/fortnite"
"github.com/ectrc/snow/person"
"github.com/ectrc/snow/storage"
"github.com/gofiber/fiber/v2"
)
func GetStorefrontCatalog(c *fiber.Ctx) error {
person := c.Locals("person").(*person.Person)
return c.Status(fiber.StatusOK).JSON(fortnite.StaticCatalog.GenerateFortniteCatalog(person))
}
func GetStorefrontKeychain(c *fiber.Ctx) error {
var keychain []string
err := json.Unmarshal(*storage.Asset("keychain.json"), &keychain)
if err != nil {
return c.Status(fiber.StatusInternalServerError).JSON(aid.JSON{"error":err.Error()})
}
return c.Status(fiber.StatusOK).JSON(keychain)
}