mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 18:42:34 +01:00
Merge pull request #584 from zurdi15/fix/remove_platform
Fix remove platform
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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[] }> {
|
||||
|
||||
Reference in New Issue
Block a user