Clarified code slightly

This commit is contained in:
James Ketr 2025-09-15 13:58:24 -07:00
parent 734f69fcae
commit 825544002e

View File

@ -35,10 +35,9 @@ const BotConfigComponent: React.FC<BotConfigProps> = ({ botInstanceId, botName,
setError(null); setError(null);
// Use bot instance ID if available, otherwise fall back to bot name // Use bot instance ID if available, otherwise fall back to bot name
const identifier = botInstanceId || botName;
const endpointPath = botInstanceId const endpointPath = botInstanceId
? `/api/bots/config/schema/instance/${identifier}` ? `/api/bots/config/schema/instance/${botInstanceId}`
: `/api/bots/config/schema/${identifier}`; : `/api/bots/config/schema/${botName}`;
// Use refresh endpoint if force refresh is requested // Use refresh endpoint if force refresh is requested
const url = forceRefresh ? `${base}${endpointPath}/refresh` : `${base}${endpointPath}`; const url = forceRefresh ? `${base}${endpointPath}/refresh` : `${base}${endpointPath}`;