mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-12 14:14:47 +00:00
fix(api): remove stale legacy profile target mappings
- delete profile_targets entry when deleting a legacy API profile - prune empty profile_targets object to avoid config drift
This commit is contained in:
1 parent
1c7e4e116f
commit
e32dedcf4c
1 file changed
+6
@@ -251,6 +251,12 @@ function removeApiProfileUnified(name: string): void {
|
|||||||
function removeApiProfileLegacy(name: string): void {
|
function removeApiProfileLegacy(name: string): void {
|
||||||
const config = loadConfigSafe();
|
const config = loadConfigSafe();
|
||||||
delete config.profiles[name];
|
delete config.profiles[name];
|
||||||
|
if (config.profile_targets) {
|
||||||
|
delete config.profile_targets[name];
|
||||||
|
if (Object.keys(config.profile_targets).length === 0) {
|
||||||
|
delete config.profile_targets;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const configPath = getConfigPath();
|
const configPath = getConfigPath();
|
||||||
const tempPath = configPath + '.tmp';
|
const tempPath = configPath + '.tmp';
|
||||||
|
|||||||
Reference in new issue
Block a user