fix(api): populate Repo field in release API responses
All checks were successful
Build and Release / Unit Tests (push) Successful in 7m8s
Build and Release / Create Release (push) Successful in 0s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 7m33s
Build and Release / Lint (push) Successful in 7m50s
Build and Release / Build Binaries (amd64, darwin, macos) (push) Successful in 4m31s
Build and Release / Build Binaries (arm64, darwin, macos) (push) Successful in 4m39s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Successful in 9h5m34s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Successful in 12m17s
Build and Release / Build Binary (linux/arm64) (push) Successful in 33m20s
All checks were successful
Build and Release / Unit Tests (push) Successful in 7m8s
Build and Release / Create Release (push) Successful in 0s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 7m33s
Build and Release / Lint (push) Successful in 7m50s
Build and Release / Build Binaries (amd64, darwin, macos) (push) Successful in 4m31s
Build and Release / Build Binaries (arm64, darwin, macos) (push) Successful in 4m39s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Successful in 9h5m34s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Successful in 12m17s
Build and Release / Build Binary (linux/arm64) (push) Successful in 33m20s
Set release.Repo before converting to API format in all v2 release endpoints (CheckAppUpdate, ListReleasesV2, GetReleaseV2, GetLatestReleaseV2). Ensures repository information is available in API responses
This commit is contained in:
@@ -148,6 +148,7 @@ func CheckAppUpdate(ctx *context.APIContext) {
|
|||||||
ctx.APIErrorInternal(err)
|
ctx.APIErrorInternal(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
latestRelease.Repo = repo
|
||||||
|
|
||||||
// Find the appropriate asset for this platform/arch
|
// Find the appropriate asset for this platform/arch
|
||||||
downloadURL, platformInfo := findUpdateAsset(latestRelease, platform, arch)
|
downloadURL, platformInfo := findUpdateAsset(latestRelease, platform, arch)
|
||||||
@@ -346,6 +347,7 @@ func ListReleasesV2(ctx *context.APIContext) {
|
|||||||
// Convert to API format
|
// Convert to API format
|
||||||
apiReleases := make([]*api.Release, 0, len(releases))
|
apiReleases := make([]*api.Release, 0, len(releases))
|
||||||
for _, release := range releases {
|
for _, release := range releases {
|
||||||
|
release.Repo = repo
|
||||||
apiReleases = append(apiReleases, convertToAPIRelease(repo, release))
|
apiReleases = append(apiReleases, convertToAPIRelease(repo, release))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,6 +390,7 @@ func GetReleaseV2(ctx *context.APIContext) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
release.Repo = repo
|
||||||
ctx.JSON(http.StatusOK, convertToAPIRelease(repo, release))
|
ctx.JSON(http.StatusOK, convertToAPIRelease(repo, release))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -436,6 +439,7 @@ func GetLatestReleaseV2(ctx *context.APIContext) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
release.Repo = repo
|
||||||
ctx.JSON(http.StatusOK, convertToAPIRelease(repo, release))
|
ctx.JSON(http.StatusOK, convertToAPIRelease(repo, release))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user