mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 05:41:05 +08:00
17 lines
545 B
JavaScript
17 lines
545 B
JavaScript
|
const {PubsubConnector, MessageTypes} = require('nylas-core')
|
||
|
|
||
|
module.exports = {
|
||
|
createSyncbackRequest: function createSyncbackRequest(request, reply, syncRequestArgs) {
|
||
|
request.getAccountDatabase().then((db) => {
|
||
|
db.SyncbackRequest.create(syncRequestArgs).then((syncbackRequest) => {
|
||
|
PubsubConnector.notify({
|
||
|
accountId: db.accountId,
|
||
|
type: MessageTypes.SYNCBACK_REQUESTED,
|
||
|
data: syncbackRequest.id,
|
||
|
});
|
||
|
reply(Serialization.jsonStringify(syncbackRequest))
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
}
|