feat: Implemented emulator versions and updating

This commit is contained in:
Simeon Radivoev 2026-04-03 23:02:22 +03:00
parent a69147a4f7
commit 34db717ec5
Signed by: simeonradivoev
GPG key ID: 7611A451D2A5D37A
22 changed files with 434 additions and 212 deletions

View file

@ -64,9 +64,9 @@ export const storeGetStatsQuery = queryOptions({
});
export const installEmulatorMutation = (id: string) => mutationOptions({
mutationKey: ['install', 'emulator', id],
mutationFn: async (source: string) =>
mutationFn: async (ctx: { source: string, isUpdate: boolean; }) =>
{
const { data, error } = await storeApi.api.store.install.emulator({ id })({ source }).post();
const { data, error } = await storeApi.api.store.install.emulator({ id })({ source: ctx.source }).post({ isUpdate: ctx.isUpdate });
if (error) throw error;
return data;
}
@ -85,4 +85,12 @@ export const deleteBiosMutation = mutationOptions({
const { error } = await storeApi.api.store.bios({ id }).delete();
if (error) throw error;
}
});
export const getUpdateInfoForEmulator = (id: string) => queryOptions({
queryKey: ['emulator', 'update'], queryFn: async () =>
{
const { data, error } = await storeApi.api.store.emulator({ id }).update.get();
if (error) throw error;
return data;
}
});