From 992ae79fc3fcdd0551498dad98fbc53af52ac495 Mon Sep 17 00:00:00 2001 From: abdou6666 Date: Mon, 24 Mar 2025 11:59:18 +0100 Subject: [PATCH] fix: update block controller --- api/src/chat/controllers/block.controller.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/src/chat/controllers/block.controller.ts b/api/src/chat/controllers/block.controller.ts index c490ed84..92b48823 100644 --- a/api/src/chat/controllers/block.controller.ts +++ b/api/src/chat/controllers/block.controller.ts @@ -93,7 +93,7 @@ export class BlockController extends BaseController< * @returns An array containing the settings of the specified plugin. */ @Get('customBlocks/settings') - findSettings(@Query('plugin') pluginName: PluginName) { + async findSettings(@Query('plugin') pluginName: PluginName) { try { if (!pluginName) { throw new BadRequestException( @@ -110,7 +110,7 @@ export class BlockController extends BaseController< throw new NotFoundException('Plugin Not Found'); } - return plugin.getDefaultSettings(); + return await plugin.getDefaultSettings(); } catch (e) { this.logger.error('Unable to fetch plugin settings', e); throw e; @@ -123,7 +123,7 @@ export class BlockController extends BaseController< * @returns An array containing available custom blocks. */ @Get('customBlocks') - findAll() { + async findAll() { try { const plugins = this.pluginsService .getAllByType(PluginType.block) @@ -150,7 +150,7 @@ export class BlockController extends BaseController< typeof p.effects === 'object' ? Object.keys(p.effects) : [], }; }); - return plugins; + return await Promise.all(plugins); } catch (e) { this.logger.error(e); throw e;