File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -343,7 +343,8 @@ Output absolutely no text except for that final JSON.
343343 return noFoundFallback ;
344344 }
345345
346- const finalText = lastMsg . content . trim ( ) ;
346+ let finalText = lastMsg . content . trim ( ) ;
347+ finalText = finalText . startsWith ( '```json' ) ? finalText . slice ( 7 , - 3 ) : finalText ;
347348
348349 try {
349350 const parsed = JSON . parse ( finalText ) ;
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import {
1717} from '@adobe/spacecat-shared-data-access' ;
1818import { BaseSlackClient , SLACK_TARGETS } from '@adobe/spacecat-shared-slack-client' ;
1919import { Blocks , Elements , Message } from 'slack-block-builder' ;
20+ import { hasText } from '@adobe/spacecat-shared-utils' ;
2021import { BUTTON_LABELS } from '../../../controllers/hooks.js' ;
2122import { composeReply , extractURLFromSlackMessage } from './commons.js' ;
2223import { getHlxConfigMessagePart } from '../../../utils/slack/base.js' ;
@@ -124,7 +125,7 @@ export default function approveSiteCandidate(lambdaContext) {
124125
125126 log . info ( `Detected org: ${ JSON . stringify ( org ) } ` ) ;
126127
127- if ( org ) {
128+ if ( hasText ( org ?. name ) && hasText ( org ?. imsOrgId ) ) {
128129 const { name, imsOrgId } = org ;
129130
130131 const orgMsg = Message ( )
You can’t perform that action at this time.
0 commit comments