feat: Implemented emulator versions and updating
This commit is contained in:
parent
a69147a4f7
commit
34db717ec5
22 changed files with 434 additions and 212 deletions
|
|
@ -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;
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue