mirror of
https://github.com/tiennm99/ccs.git
synced 2026-08-09 12:23:30 +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:
@@ -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