Buildfire - bulkInsert Error

46 Views Asked by At

I'm trying to do a bulkInsert but I keep getting a 400 error message:

{code: "VALIDATION", message: "Invalid parameters"}

Here is my code:

import React, { Component } from 'react';

class App extends Component {
  constructor(props) {
    super(props);

    this.testFn = this.testFn.bind(this);
  }


  testFn() {
    const data = [{name:"John Doe", tel:"555-111-1111"},{name:"John Doe", tel:"555-222-2222"}];

    buildfire.publicData.bulkInsert(data, 'testTag', function(err, res) {
      if (err) {
        console.log("ERROR", err);
      } else {
        console.log("SUCCESSFULLY BULK INSERTED", res);
      }
    });
  }


  render() {
    return (
      <div>
        <button onClick={this.testFn}>Test Insert</button>
      </div>
    );
  }
}

export default App;

If I change buildfire.publicData.bulkInsert to buildfire.publicData.insert the call is successful and I can find my array in res.data but I want each object to create it's own record. The example data I am trying to save is coming straight from the docs.

1

There are 1 best solutions below

0
On

I had been able to reproduce the issue that you described, although it seems to no longer be a problem. Perhaps it was a temporary glitch, or something was changed in the system recently.

I'd suggest trying again, as it appears to be working fine now.