Skip to content

Commit

Permalink
Merge pull request #92 from zurdi15/fix/delete_rom
Browse files Browse the repository at this point in the history
Fix/delete rom
  • Loading branch information
zurdi15 authored Mar 30, 2023
2 parents 2c0afcc + 96e1325 commit 1bcb015
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ assignees: zurdi15

---

**RomM version**
Version of RomM you are using

**Describe the bug**
A clear and concise description of what the bug is.

Expand Down
20 changes: 10 additions & 10 deletions backend/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ async def rom(p_slug: str, file_name: str) -> dict:
return {'data': dbh.get_rom(p_slug, file_name)}


@app.delete("/platforms/{p_slug}/roms/{file_name}")
async def delete_rom(p_slug: str, file_name: str, filesystem: bool=False) -> dict:
"""Detele rom from filesystem and database"""

log.info("deleting rom...")
if filesystem: fs.delete_rom(p_slug, file_name)
dbh.delete_rom(p_slug, file_name)
return {'msg': 'success'}


@app.patch("/platforms/{p_slug}/roms")
async def updateRom(req: Request, p_slug: str) -> dict:
"""Updates rom details"""
Expand Down Expand Up @@ -50,16 +60,6 @@ async def updateRom(req: Request, p_slug: str) -> dict:
return {'data': updatedRom}


@app.delete("/platforms/{p_slug}/roms")
async def delete_rom(p_slug: str, file_name: str, filesystem: bool=False) -> dict:
"""Detele rom from filesystem and database"""

log.info("deleting rom...")
if filesystem: fs.delete_rom(p_slug, file_name)
dbh.delete_rom(p_slug, file_name)
return {'msg': 'success'}


@app.get("/platforms/{p_slug}/roms")
async def roms(p_slug: str) -> dict:
"""Returns all roms of the desired platform"""
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v1.5.1 (_31-03-2023_)

## Fix
- Delete game now works properly

# v1.5 (_30-03-2023_)

**`Breaking change`**
Expand Down

0 comments on commit 1bcb015

Please sign in to comment.