mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-03-06 07:16:10 -05:00
fixed general settings
This commit is contained in:
@@ -376,8 +376,12 @@ public class ConfigurationController : ControllerBase
|
||||
var oldConfig = await _dataContext.GeneralConfigs
|
||||
.FirstAsync();
|
||||
|
||||
// Apply updates from DTO
|
||||
newConfig.Adapt(oldConfig);
|
||||
// Apply updates from DTO, excluding the ID property to avoid EF key modification error
|
||||
var config = new TypeAdapterConfig();
|
||||
config.NewConfig<GeneralConfig, GeneralConfig>()
|
||||
.Ignore(dest => dest.Id);
|
||||
|
||||
newConfig.Adapt(oldConfig, config);
|
||||
|
||||
// Persist the configuration
|
||||
await _dataContext.SaveChangesAsync();
|
||||
|
||||
Reference in New Issue
Block a user