Announcement

Collapse
No announcement yet.

Cannot use searchParams ( seems some bug ?? )

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot use searchParams ( seems some bug ?? )

    When i in node.js trying to search by chat name, i'm getting just last record info.
    I tested with various type = contains, equal noting is working .. im jsut getting last record info

    let searchParams = {
    maxSize: 1,
    primaryFilter: 'open',
    where: [{type: 'contains', attribute: 'name', value: 'QZ2KWE9WFB',}],
    select: 'id,name,assignedUserId,assignedUserName'
    };

    // request
    ecrmclient.request('GET', 'Chat', searchParams)
    .then((response) => {
    console.log(response);
    }).catch((res) => {
    console.log(res);
    });

    // Responce is
    {
    total: 38392,
    list: [
    {
    id: '6144cd24b3f86a3ed',
    name: 'QZ4LQ7RXVQ',
    chatEndDate: '2021-09-17 16:55:47',
    createdById: '60278a74f0ff3c4ef',
    assignedUserId: '603c06099d118b111',
    assignedUserName: 'Some name'
    }
    ]
    }

  • #2
    I found solution, i have to define searchParams in this format ...

    let searchParams = {maxSize: 1, 'where[0][type]': 'equals', 'where[0][attribute]': 'name', 'where[0][value]': 'QZ2KTDR8WW'};

    Comment

    Working...
    X