Skip to content

Commit

Permalink
LPD-41296 Update Json Response
Browse files Browse the repository at this point in the history
  • Loading branch information
kevenleone authored and brianchandotcom committed Nov 11, 2024
1 parent f2c23c3 commit 07b65c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import OAuth2Client from './OAuth2Client';

export default class AIWizardContentOAuth2 extends OAuth2Client {
constructor() {
super('liferay-aicontentwizard-etc-spring-boot-oauth-application-user-agent');
super(
'liferay-aicontentwizard-etc-spring-boot-oauth-application-user-agent'
);
}

async deleteSetting(id: number) {
Expand All @@ -35,21 +37,27 @@ export default class AIWizardContentOAuth2 extends OAuth2Client {
}

async getSettingsStatus(): Promise<any> {
return this.fetch('/settings/status');
const response = await this.fetch('/settings/status');

return response.json();
}

async getSetting(id: string): Promise<any> {
return this.fetch(`/settings/${id}`);
}

async getSettings(): Promise<any> {
return this.fetch('/settings');
const response = await this.fetch('/settings');

return response.json();
}

async saveSettings(data: unknown) {
return this.fetch('/settings', {
const response = await this.fetch('/settings', {
body: JSON.stringify(data),
method: 'POST',
});

return response.json();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ public ResponseEntity<String> generate(@RequestBody String json)
).tools(
new AccountTools(toolsContext), new BlogPostingTools(toolsContext),
new KnowledgeBaseTools(toolsContext),
new SitePageTools(toolsContext), new SiteTools(toolsContext),
new TaxonomyTools(toolsContext)
new SitePageTools(toolsContext), new SiteTools(toolsContext)
).chatMemory(
MessageWindowChatMemory.withMaxMessages(10)
).build();
Expand Down

0 comments on commit 07b65c9

Please sign in to comment.