🐛 Fix destination loading

This commit is contained in:
2024-12-29 00:03:00 +08:00
parent cd0141f5b1
commit 3a00a06541
4 changed files with 16 additions and 13 deletions

View File

@ -2,14 +2,14 @@ package api
import (
"git.solsynth.dev/hypernet/paperclip/pkg/internal/models"
"git.solsynth.dev/hypernet/paperclip/pkg/internal/services"
"github.com/gofiber/fiber/v2"
jsoniter "github.com/json-iterator/go"
"github.com/spf13/viper"
)
func listDestination(c *fiber.Ctx) error {
var destinations []models.BaseDestination
for _, value := range viper.GetStringSlice("destinations") {
for _, value := range services.DestinationsByIndex {
var parsed models.BaseDestination
raw, _ := jsoniter.Marshal(value)
_ = jsoniter.Unmarshal(raw, &parsed)