Good night everyone, I have the following problem. I'm using a sync function from WatermelonDB but it's giving this error when it runs. I'm sure an object manually to see why it doesn't work.
And that same object works if it's inserted out of sync. Does anyone know how to fix?
await synchronize({
database,
pullChanges: async ({ lastPulledAt }) => {
const { data } = await api.get(`/sync/pull/${1637416552 || 0}`);
console.log(JSON.stringify(data.changes, null, 2));
return {
// changes: data.changes,
changes: {
sub_workspaces: {
created: [
{
sub_workspace_id: 57,
name: "Teiu",
avatar_url: "-",
slug: "teiu",
workspace_id: 19,
},
],
updated: [],
deleted: [],
},
},
timestamp: 1637416552,
};
},
pushChanges: async ({ changes }) => {},
});
import { tableSchema } from '@nozbe/watermelondb'
const subWorskapceSchema = tableSchema({
name: 'sub_workspaces',
columns: [
{
name: 'sub_workspace_id',
type: 'number',
},
{
name: 'name',
type: 'string'
},
{
name: 'avatar_url',
type: 'string'
},
{
name: 'slug',
type: 'string'
},
{
name: 'workspace_id',
type: 'number'
},
]
})
export { subWorskapceSchema }