File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 11import ExcelJS from 'exceljs' ;
22import fs from 'fs' ;
3+ import { Op } from 'sequelize' ;
34import { AutoReply } from '../entities/autoReply' ;
45import { ALL_PLATFORMS } from '../constants' ;
56import { getTempPath } from '../../utils' ;
@@ -146,7 +147,9 @@ export class AutoReplyController {
146147
147148 const globalKeywords = await AutoReply . findAll ( {
148149 where : {
149- platform_id : '' ,
150+ platform_id : {
151+ [ Op . or ] : [ null , '' ] ,
152+ } ,
150153 } ,
151154 } ) ;
152155
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ export class StrategyService {
8484 const data = await this . emitAndWait < Platform [ ] > (
8585 'strategyService-getAllPlatforms' ,
8686 ) ;
87- return data ;
87+ return data . length > 0 ? data : ALL_PLATFORMS ;
8888 } catch ( error ) {
8989 console . error ( 'Failed to update strategies' , error ) ;
9090 return ALL_PLATFORMS ;
Original file line number Diff line number Diff line change @@ -74,8 +74,9 @@ const EditKeyword = ({
7474 }
7575
7676 setPtf ( editKeyword ?. platform_id || '' ) ;
77+
7778 if ( editKeyword ) {
78- setIsGlobal ( editKeyword . platform_id === '' ) ;
79+ setIsGlobal ( ! editKeyword . platform_id ) ;
7980 }
8081 } , [ editKeyword ] ) ;
8182
You can’t perform that action at this time.
0 commit comments