diff --git a/frontend/src/api/data.js b/frontend/src/api/data.js index 205ef59..526f670 100644 --- a/frontend/src/api/data.js +++ b/frontend/src/api/data.js @@ -265,6 +265,7 @@ const createSpecialEndpoint = (category, endpoint) => async data => { try { validateResourceName('category', category); validatePath([category, endpoint]); + console.log(`Sending data to ${endpoint}:`, data); const response = await axios.post( `${BASE_URL}/${category}/${endpoint}`, data diff --git a/frontend/src/components/format/FormatCard.jsx b/frontend/src/components/format/FormatCard.jsx index 7a80a31..ac65210 100644 --- a/frontend/src/components/format/FormatCard.jsx +++ b/frontend/src/components/format/FormatCard.jsx @@ -19,15 +19,12 @@ function FormatCard({ const passRate = Math.round((passedTests / totalTests) * 100) || 0; const getConditionStyle = condition => { - if (condition.required && condition.negate) { - return 'bg-orange-100 border-orange-200 text-orange-700 dark:bg-orange-900/30 dark:border-orange-700 dark:text-orange-300'; + if (condition.negate) { + return 'bg-red-100 border-red-200 text-red-700 dark:bg-red-900/30 dark:border-red-700 dark:text-red-300'; } if (condition.required) { return 'bg-green-100 border-green-200 text-green-700 dark:bg-green-900/30 dark:border-green-700 dark:text-green-300'; } - if (condition.negate) { - return 'bg-red-100 border-red-200 text-red-700 dark:bg-red-900/30 dark:border-red-700 dark:text-red-300'; - } return 'bg-blue-100 border-blue-200 text-blue-700 dark:bg-blue-900/30 dark:border-blue-700 dark:text-blue-300'; }; @@ -43,9 +40,9 @@ function FormatCard({ if (sortedConditions.length <= 5) return sortedConditions; - // Take first 4 conditions and add a count of remaining ones - const displayConditions = sortedConditions.slice(0, 4); - const remainingCount = sortedConditions.length - 4; + // Take first 6 conditions and add a count of remaining ones + const displayConditions = sortedConditions.slice(0, 6); + const remainingCount = sortedConditions.length - 6; // Add a virtual condition for the count displayConditions.push({ diff --git a/frontend/src/components/regex/RegexModal.jsx b/frontend/src/components/regex/RegexModal.jsx index 8fd83ae..d07359a 100644 --- a/frontend/src/components/regex/RegexModal.jsx +++ b/frontend/src/components/regex/RegexModal.jsx @@ -68,7 +68,7 @@ const RegexModal = ({ } catch (error) { console.error('Error deleting pattern:', error); Alert.error( - error.message || + error.response?.data?.error || 'Failed to delete pattern. Please try again.' ); } finally { diff --git a/frontend/src/hooks/useFormatModal.js b/frontend/src/hooks/useFormatModal.js index ef39077..6e42174 100644 --- a/frontend/src/hooks/useFormatModal.js +++ b/frontend/src/hooks/useFormatModal.js @@ -224,10 +224,10 @@ export const useFormatModal = (initialFormat, onSuccess) => { } catch (error) { console.error('Error deleting format:', error); Alert.error( - error.message || + error.response?.data?.error || 'Failed to delete format. Please try again.' ); - setIsDeleting(false); // Reset delete state on error + setIsDeleting(false); } } else { setIsDeleting(true);