mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-01-03 12:47:13 -06:00
SEARCH-154 & SEARCH-116
1. Serialized the messages array from the client app
This commit is contained in:
parent
c8b45e091e
commit
59505ed93d
@ -109,7 +109,7 @@ class Search {
|
||||
*/
|
||||
indexBatch(messages) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!Array.isArray(messages)) {
|
||||
if (!messages && !(JSON.parse(messages) instanceof Array)) {
|
||||
reject(new Error('Messages must be an array'));
|
||||
return;
|
||||
}
|
||||
@ -120,7 +120,7 @@ class Search {
|
||||
}
|
||||
|
||||
const indexId = randomString.generate(BATCH_RANDOM_INDEX_PATH_LENGTH);
|
||||
libSymphonySearch.symSECreatePartialIndexAsync(this.batchIndex, indexId, JSON.stringify(messages), (err, res) => {
|
||||
libSymphonySearch.symSECreatePartialIndexAsync(this.batchIndex, indexId, messages, (err, res) => {
|
||||
if (err) {
|
||||
reject(new Error(err));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user