mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-17 19:36:28 +02:00
Settings API PATCH Method
- Added PATCH support to `/api/settings` for Home Assistant rest_command compatibility Closes #152
This commit is contained in:
@@ -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`
|
||||
|
||||
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user