fix(investor): simplify preparation flow, profile requests and scoped zone search
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-28 21:26:59 +02:00
parent 54d1b2a543
commit 502e3ec4d5
23 changed files with 573 additions and 101 deletions
@@ -0,0 +1,11 @@
const territoryKeys=['province_id','district_id','admin_post_id','locality_id'];
/** No fallback scope: an explicit empty path means all; a selected path replaces its old descendants. */
export function territorialSearchParams(entries: Iterable<[string,FormDataEntryValue]>, path?: {id:string;location_type:string}[]): URLSearchParams {
const params=new URLSearchParams();
for(const [key,value] of entries)if(typeof value==='string'&&value!==''&&key!=='page')params.set(key,value);
if(path){
territoryKeys.forEach(key=>params.delete(key));
for(const node of path){const key=`${node.location_type}_id`;if(territoryKeys.includes(key))params.set(key,node.id);}
}
return params;
}