mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2026-04-17 15:40:41 -04:00
Refactor: Database and UI updates
This commit is contained in:
@@ -118,13 +118,15 @@ serve(async (req) => {
|
||||
|
||||
reportedEntityName = profile?.display_name || profile?.username || 'User Profile';
|
||||
} else if (payload.reportedEntityType === 'content_submission') {
|
||||
const { data: submission } = await supabase
|
||||
.from('content_submissions')
|
||||
.select('content')
|
||||
.eq('id', payload.reportedEntityId)
|
||||
// Query submission_metadata table for the name instead of dropped content JSONB column
|
||||
const { data: metadata } = await supabase
|
||||
.from('submission_metadata')
|
||||
.select('metadata_value')
|
||||
.eq('submission_id', payload.reportedEntityId)
|
||||
.eq('metadata_key', 'name')
|
||||
.maybeSingle();
|
||||
|
||||
reportedEntityName = submission?.content?.name || 'Submission';
|
||||
reportedEntityName = metadata?.metadata_value || 'Submission';
|
||||
}
|
||||
} catch (error) {
|
||||
edgeLogger.warn('Could not fetch entity name', { action: 'notify_moderators_report', requestId: tracking.requestId, error });
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
-- Add is_test_data column to profiles table for test data cleanup
|
||||
-- This enables Playwright tests to mark and clean up test records
|
||||
|
||||
ALTER TABLE public.profiles
|
||||
ADD COLUMN IF NOT EXISTS is_test_data BOOLEAN DEFAULT false NOT NULL;
|
||||
|
||||
-- Add index for efficient test data cleanup queries
|
||||
CREATE INDEX IF NOT EXISTS idx_profiles_is_test_data
|
||||
ON public.profiles(is_test_data)
|
||||
WHERE is_test_data = true;
|
||||
|
||||
COMMENT ON COLUMN public.profiles.is_test_data IS 'Flag indicating this is test data that should be cleaned up by automated tests';
|
||||
Reference in New Issue
Block a user