diff --git a/CHANGELOG.md b/CHANGELOG.md index a41dda967..6cf0f0bab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/backend/app/api/routes/settings.py b/backend/app/api/routes/settings.py index 207ea613a..b16d95ab7 100644 --- a/backend/app/api/routes/settings.py +++ b/backend/app/api/routes/settings.py @@ -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."""