Skip to content

Commit

Permalink
Merge pull request #34 from forcedotcom/sh/api-fixes
Browse files Browse the repository at this point in the history
fix: correct expected draft topic response
  • Loading branch information
shetzel authored Jan 24, 2025
2 parents f28407c + 67f8f3c commit ecd7b9c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ export class Agent implements SfAgent {

const response = await this.maybeMock.request<DraftAgentTopicsResponse>('POST', url, body);

if (response.isSuccess && response.topics) {
return { ...config, topics: response.topics };
if (response.isSuccess && response.topicDrafts) {
return { ...config, topics: response.topicDrafts };
} else {
throw SfError.create({
name: 'AgentJobSpecCreateError',
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,5 @@ export type DraftAgentTopics = [
export type DraftAgentTopicsResponse = {
isSuccess: boolean;
errorMessage?: string;
topics: DraftAgentTopics;
topicDrafts: DraftAgentTopics;
};
2 changes: 1 addition & 1 deletion test/mocks/connect_ai-assist_draft-agent-topics.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"isSuccess": true,
"topics": [
"topicDrafts": [
{
"name": "Guest_Experience_Enhancement",
"description": "Develop and implement entertainment programs to enhance guest experience."
Expand Down

0 comments on commit ecd7b9c

Please sign in to comment.