"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getPostErrorMessage = exports.getCommentErrorMessage = void 0;
var _constants = require("../../core/constants");
const getCommentErrorMessage = error => {
  if (error.message.includes(_constants.ERROR_CODE.BLOCKED_WORD)) {
    return _constants.COMMENT_ERROR_MESSAGE.BLOCKED_WORD;
  }
  if (error.message.includes(_constants.ERROR_CODE.BLOCKED_URL)) {
    return _constants.COMMENT_ERROR_MESSAGE.BLOCKED_URL;
  }
  return _constants.COMMENT_ERROR_MESSAGE.GENERIC;
};
exports.getCommentErrorMessage = getCommentErrorMessage;
const getPostErrorMessage = (error, isEditMode) => {
  if (error.message.includes(_constants.ERROR_CODE.BLOCKED_WORD)) {
    return _constants.POST_ERROR_MESSAGE.BLOCKED_WORD;
  }
  if (error.message.includes(_constants.ERROR_CODE.BLOCKED_URL)) {
    return _constants.POST_ERROR_MESSAGE.BLOCKED_URL;
  }
  return isEditMode ? _constants.POST_ERROR_MESSAGE.GENERIC_EDIT : _constants.POST_ERROR_MESSAGE.GENERIC_CREATE;
};
exports.getPostErrorMessage = getPostErrorMessage;
//# sourceMappingURL=errors.js.map