completed adding MediaLofi for kontor-gin
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
This commit is contained in:
@@ -36,14 +36,19 @@ var addLinksCmd = &cobra.Command{
|
||||
token := api.GetToken(client, localServer)
|
||||
for _, line := range lines {
|
||||
lofiAdd := models.MediaLofiAdd{Url: line}
|
||||
addResult := &models.MediaLoFi{}
|
||||
response, err := client.R().
|
||||
SetBody(lofiAdd).
|
||||
SetAuthToken(token).
|
||||
SetHeader("Accept", "application/json").
|
||||
Post("http://localhost:8550/api/v1/media/lofi")
|
||||
SetResult(addResult).
|
||||
Post("http://localhost:8550/api/v1/media/lofis")
|
||||
if err != nil {
|
||||
slog.Info("Add Lofi", "error", err.Error())
|
||||
}
|
||||
if addResult != nil {
|
||||
slog.Info("Lofi added", "lofi", addResult)
|
||||
}
|
||||
slog.Info("Add Lofi", "status", response.StatusCode(), "body", response.Body)
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user