mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-02-17 15:01:42 +08:00
Actually fix version list order
This commit is contained in:
parent
e467c51153
commit
d2058d5e17
@ -53,9 +53,6 @@ const requestOptions = computed(() => {
|
||||
|
||||
const channels = await useProjectChannels(route.params.user as string, route.params.project as string).catch((e) => handleRequestError(e, ctx, i18n));
|
||||
const versions = await useProjectVersions(route.params.user as string, route.params.project as string).catch((e) => handleRequestError(e, ctx, i18n));
|
||||
if (versions && versions.value) {
|
||||
versions.value.result.reverse();
|
||||
}
|
||||
|
||||
if (channels) {
|
||||
filter.channels.push(...(channels.value?.map((c) => c.name) || []));
|
||||
@ -84,7 +81,6 @@ watch(
|
||||
).catch((e) => handleRequestError(e, ctx, i18n));
|
||||
if (newVersions) {
|
||||
versions.value = newVersions;
|
||||
versions.value.result.reverse();
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
|
@ -55,7 +55,10 @@ public class VersionsApiService extends HangarComponent {
|
||||
|
||||
public PaginatedResult<Version> getVersions(String author, String slug, RequestPagination pagination) {
|
||||
boolean canSeeHidden = getGlobalPermissions().has(Permission.SeeHidden);
|
||||
List<Version> versions = versionsApiDAO.getVersions(author, slug, canSeeHidden, getHangarUserId(), pagination).entrySet().stream().map(entry -> versionDependencyService.addDependencies(entry.getKey(), entry.getValue())).collect(Collectors.toList());
|
||||
List<Version> versions = versionsApiDAO.getVersions(author, slug, canSeeHidden, getHangarUserId(), pagination).entrySet().stream()
|
||||
.map(entry -> versionDependencyService.addDependencies(entry.getKey(), entry.getValue()))
|
||||
.sorted((v1, v2) -> v2.getCreatedAt().compareTo(v1.getCreatedAt()))
|
||||
.collect(Collectors.toList());
|
||||
Long versionCount = versionsApiDAO.getVersionCount(author, slug, canSeeHidden, getHangarUserId(), pagination);
|
||||
return new PaginatedResult<>(new Pagination(versionCount == null ? 0 : versionCount, pagination), versions);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user