Skip to content
Permalink
Browse files

added example

  • Loading branch information...
squallstar committed Jul 4, 2019
1 parent ea1c1cb commit aa578da4117b4b931e694205b7ee48d26097c222
Showing with 14 additions and 2 deletions.
  1. +14 −2 docs/Data-integration-service.md
@@ -389,14 +389,26 @@ module.exports.setup = (agent) => {
// The target data source ID
targetDataSourceId: 123,
// Define an optional "where" query filter
// Define an optional "where" query filter using sequelize operators
where: {
'Foo': 'Bar'
syncedAt: null
},
// Action to run when the data is retrieved
action: (entries, db) => {
console.log(entries)
// You can write data back to Fliplet APIs if necessary,
// e.g. confirm you have sync these entries
return Promise.all(entries.map((entry) => {
return agent.api.request({
url: `v1/data-sources/456/data/${entry.id}`,
method: 'PUT',
data: {
syncedAt: Date.now()
}
});
}));
}
});

0 comments on commit aa578da

Please sign in to comment.
You can’t perform that action at this time.