Settings API PATCH Method

- Added PATCH support to `/api/settings` for Home Assistant rest_command compatibility

Closes #152
This commit is contained in:
maziggy
2026-01-25 13:43:47 +01:00
parent ec3c47f048
commit 3a3f6a1845
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -34,6 +34,7 @@ All notable changes to Bambuddy will be documented in this file.
- Bulk delete for multiple files at once
### Fixes
- **Settings API PATCH Method** - Added PATCH support to `/api/settings` for Home Assistant rest_command compatibility (Issue #152)
- **P2S Empty Archive Tiles** - Fixed FTP file search for printers without SD card (Issue #146):
- Added root folder `/` to search paths when looking for 3MF files
- Printers without SD card store files in root instead of `/cache`
+10
View File
@@ -164,6 +164,16 @@ async def update_settings(
return await get_settings(db)
@router.patch("/", response_model=AppSettings)
@router.patch("", response_model=AppSettings)
async def patch_settings(
settings_update: AppSettingsUpdate,
db: AsyncSession = Depends(get_db),
):
"""Partially update application settings (same as PUT, for REST compatibility)."""
return await update_settings(settings_update, db)
@router.post("/reset", response_model=AppSettings)
async def reset_settings(db: AsyncSession = Depends(get_db)):
"""Reset all settings to defaults."""