Mailspring/packages/nylas-sync/syncback_tasks/delete-folder.imap.js
2016-06-30 11:54:12 -07:00

15 lines
367 B
JavaScript

const SyncbackTask = require('./syncback-task')
class DeleteFolderIMAP extends SyncbackTask {
description() {
return `DeleteFolder`;
}
run(db, imap) {
const folderId = this.syncbackRequestObject().props.id
return db.Folder.findById(folderId).then((folder) => {
return imap.delBox(folder.name);
})
}
}
module.exports = DeleteFolderIMAP