feat(api, agents): add agent node profile retrieval and update functionality
Implemented new API functions to fetch and update agent node profiles, enhancing the management capabilities for agent data. This addition improves the overall functionality of the admin agents console, allowing for better user interaction with agent profiles. Updated related types for improved type safety and clarity in the codebase.
This commit is contained in:
@@ -13,11 +13,24 @@ const segments = [
|
||||
{ suffix: "/finance", key: "finance", label: "subnav.finance" },
|
||||
{ suffix: "/review", key: "review", label: "subnav.review" },
|
||||
{ suffix: "/risk/occupancy", key: "riskLockLogs", label: "subnav.riskLockLogs" },
|
||||
{ suffix: "/risk/hot", key: "riskHot", label: "subnav.riskHot" },
|
||||
{ suffix: "/risk/sold-out", key: "riskSoldOut", label: "subnav.riskSoldOut" },
|
||||
{ suffix: "/risk/pools", key: "riskPools", label: "subnav.riskPools" },
|
||||
] as const;
|
||||
|
||||
function isRiskPoolsTabActive(pathname: string, base: string): boolean {
|
||||
const riskPrefix = `${base}/risk/`;
|
||||
if (!pathname.startsWith(riskPrefix)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const rest = pathname.slice(riskPrefix.length);
|
||||
return (
|
||||
rest === "pools"
|
||||
|| rest.startsWith("pools/")
|
||||
|| rest === "hot"
|
||||
|| rest === "sold-out"
|
||||
);
|
||||
}
|
||||
|
||||
function isReviewTabActive(pathname: string, base: string): boolean {
|
||||
const reviewPrefix = `${base}/review`;
|
||||
const publishPrefix = `${base}/publish`;
|
||||
@@ -42,7 +55,9 @@ export function DrawSubnav({ drawId }: { drawId: string }) {
|
||||
? pathname === base || pathname === `${base}/`
|
||||
: suffix === "/review"
|
||||
? isReviewTabActive(pathname, base)
|
||||
: pathname === href || pathname.startsWith(`${href}/`);
|
||||
: key === "riskPools"
|
||||
? isRiskPoolsTabActive(pathname, base)
|
||||
: pathname === href || pathname.startsWith(`${href}/`);
|
||||
|
||||
return (
|
||||
<Link
|
||||
|
||||
Reference in New Issue
Block a user