mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-01-05 21:54:05 -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) {
|
indexBatch(messages) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (!Array.isArray(messages)) {
|
if (!messages && !(JSON.parse(messages) instanceof Array)) {
|
||||||
reject(new Error('Messages must be an array'));
|
reject(new Error('Messages must be an array'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -120,7 +120,7 @@ class Search {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const indexId = randomString.generate(BATCH_RANDOM_INDEX_PATH_LENGTH);
|
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) {
|
if (err) {
|
||||||
reject(new Error(err));
|
reject(new Error(err));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user