Add global vs individual in settings page.
This commit is contained in:
+2
-2
@@ -17,8 +17,8 @@ public class AppSettingController {
|
||||
}
|
||||
|
||||
@PutMapping("/api/settings")
|
||||
public void updateSetting(@RequestParam String category, @RequestParam String name, @RequestParam String newValue) {
|
||||
appSettingService.updateSetting(category, name, newValue);
|
||||
public void updateSetting(@RequestParam String category, @RequestParam String name, @RequestParam String val) {
|
||||
appSettingService.updateSetting(category, name, val);
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -33,10 +33,10 @@ public class AppSettingService {
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void updateSetting(String category, String name, String newValue) {
|
||||
public void updateSetting(String category, String name, String val) {
|
||||
AppSettingEntity setting = appSettingsRepository.findByCategoryAndName(category, name);
|
||||
if (setting != null) {
|
||||
setting.setVal(newValue);
|
||||
setting.setVal(val);
|
||||
appSettingsRepository.save(setting);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Setting not found for category: " + category + " and key: " + name);
|
||||
|
||||
Reference in New Issue
Block a user