This commit is contained in:
2026-05-12 07:54:32 +03:00
parent 0faa8b9d2d
commit d49449c30c
187 changed files with 4826 additions and 5884 deletions

View File

@@ -0,0 +1,24 @@
import { useGetAssetVersions } from "infra/backend-api"
import type { AssetVersionsHistory } from "../types/assets-api.type"
/**
* История source versions выбранного asset.
*/
export const useAssetVersions = (publicId: string | null): AssetVersionsHistory => {
const versionsQuery = useGetAssetVersions(publicId)
const refresh = async () => {
await versionsQuery.mutate()
}
return {
currentVersion: versionsQuery.data?.currentVersion ?? null,
error: versionsQuery.error,
isLoading: versionsQuery.isLoading,
isRefreshing: versionsQuery.isValidating,
publicId: versionsQuery.data?.publicId ?? publicId,
refresh,
versions: versionsQuery.data?.versions ?? [],
}
}