Merge pull request #584 from zurdi15/fix/remove_platform

Fix remove platform
This commit is contained in:
Zurdi
2024-01-08 23:07:52 +01:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@@ -124,11 +124,11 @@ class DeletePlatformResponse(TypedDict):
msg: str
@protected_route(router.delete, "/platforms/{fs_slug}", ["platforms.write"])
def delete_platform(request: Request, fs_slug) -> DeletePlatformResponse:
@protected_route(router.delete, "/platforms/{slug}", ["platforms.write"])
def delete_platform(request: Request, slug) -> DeletePlatformResponse:
"""Detele platform from database [and filesystem]"""
platform = dbh.get_platform_by_fs_slug(fs_slug)
platform = dbh.get_platform(slug)
if not platform:
error = f"Platform {platform.name} - [{platform.fs_slug}] not found"
log.error(error)

View File

@@ -40,7 +40,7 @@ async function deletePlatform({
}: {
platform: PlatformSchema;
}): Promise<{ data: DeletePlatformResponse }> {
return api.delete(`/platforms/${platform.fs_slug}`);
return api.delete(`/platforms/${platform.slug}`);
}
async function fetchRecentRoms(): Promise<{ data: RomSchema[] }> {