var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.deleteReactionsForMessage = void 0;
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _createDeleteQuery = require("../sqlite-utils/createDeleteQuery");
var _SqliteClient = require("../SqliteClient");
var deleteReactionsForMessage = exports.deleteReactionsForMessage = function () {
  var _ref2 = (0, _asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(_ref) {
    var _ref$execute, execute, messageId, query;
    return _regenerator["default"].wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          _ref$execute = _ref.execute, execute = _ref$execute === void 0 ? true : _ref$execute, messageId = _ref.messageId;
          query = (0, _createDeleteQuery.createDeleteQuery)('reactions', {
            messageId: messageId
          });
          console.log('deleteReactionsForMessage', {
            execute: execute,
            messageId: messageId
          });
          if (!execute) {
            _context.next = 6;
            break;
          }
          _context.next = 6;
          return _SqliteClient.SqliteClient.executeSql.apply(null, query);
        case 6:
          return _context.abrupt("return", [query]);
        case 7:
        case "end":
          return _context.stop();
      }
    }, _callee);
  }));
  return function deleteReactionsForMessage(_x) {
    return _ref2.apply(this, arguments);
  };
}();
//# sourceMappingURL=deleteReactions.js.map