add loading links form file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s

This commit is contained in:
Thomas Peetz
2026-10-07 18:50:09 +02:00
parent 980eda29af
commit 094dffb1c7
9 changed files with 384 additions and 172 deletions
+15
View File
@@ -1,7 +1,9 @@
package cmd
import (
"kontor-api-gin/internal/api"
"log/slog"
"reflect"
"github.com/spf13/cobra"
)
@@ -13,6 +15,19 @@ var syncCmd = &cobra.Command{
// Args: cobra.ExactArgs(2),
Run: func(cmd *cobra.Command, args []string) {
slog.Info("sync kontor")
sourceData, _ := api.GetData(server, apiVersion)
targetData, _ := api.GetData("https://kontor-gin.thpeetz.de", apiVersion)
slog.Info("Size of targetData", "size", reflect.TypeOf(targetData).Size())
// find missing items in target and collect items not available in source
for table, item_list := range sourceData.GetMap() {
slog.Info("iterate sourceData", "table", table, "count", reflect.TypeOf(item_list).Size())
switch table {
case "sports":
sourceData.Sport.CompareIds(&targetData.Sport)
}
}
},
}