Skip to content

[BUG] CrudEntry data type mismatch on uploadData connector #553

Open
@rossicler-hostalky

Description

@rossicler-hostalky

Hi, I have created a common lib with a connector to upload the data to my API, but when using this in my React Native app, the transaction data is not matching the CrudEntry type. This is more or less what I have setup to test:

const transaction = await database.getNextCrudTransaction();
console.log("data", transaction.crud);

TypeScript says the type of transaction.crud is CrudEntry[], but this is what I get from the console.log:
[{"data": [Object], "id": "67ebfcb34b14c2a8b140b4e5", "op": "PUT", "op_id": 4, "tx_id": 4, "type": "mytablename"}]

For this reason my upload is failing, due to expecting the data to be something like: "op is a CrudEntry"

const record = {
  table: op.table,
  id: op.id,
  op: op.op,
  data: op.opData,
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions