Clean up codebase and reorganize plugin architecture
All checks were successful
Build And Push Image / docker (push) Successful in 1m30s
All checks were successful
Build And Push Image / docker (push) Successful in 1m30s
- Archive documentation files to docs-archive/ - Remove numbered prefixes from plugin files for cleaner organization - Remove unused dependencies (@nuxt/ui, @vuepic/vue-datepicker) - Update event components and API endpoints - Simplify plugin structure with descriptive names
This commit is contained in:
@@ -117,10 +117,24 @@ export default defineEventHandler(async (event) => {
|
||||
}
|
||||
}
|
||||
|
||||
// Get the event to find the proper event_id for RSVP tracking
|
||||
let rsvpEventId = eventId; // Default to the provided eventId
|
||||
try {
|
||||
// Try to get the event_id field if it exists in the event
|
||||
if (eventDetails.event_id) {
|
||||
rsvpEventId = eventDetails.event_id;
|
||||
console.log('[RSVP] Using event.event_id for RSVP:', rsvpEventId);
|
||||
} else {
|
||||
console.log('[RSVP] Using provided eventId for RSVP:', rsvpEventId);
|
||||
}
|
||||
} catch (eventIdError) {
|
||||
console.log('[RSVP] Could not get event_id, using provided eventId:', rsvpEventId);
|
||||
}
|
||||
|
||||
// Create RSVP record
|
||||
const rsvpData = {
|
||||
record_type: 'rsvp',
|
||||
event_id: eventId,
|
||||
event_id: rsvpEventId, // Use the business event_id field
|
||||
member_id: member.member_id || member.Id,
|
||||
rsvp_status: body.rsvp_status,
|
||||
payment_status: paymentStatus,
|
||||
|
||||
@@ -3,6 +3,15 @@ import { createNocoDBEventsClient } from '~/server/utils/nocodb-events';
|
||||
import { createSessionManager } from '~/server/utils/session';
|
||||
import type { EventCreateRequest } from '~/utils/types';
|
||||
|
||||
/**
|
||||
* Generate a unique event ID
|
||||
*/
|
||||
function generateEventId(): string {
|
||||
const timestamp = Date.now().toString(36);
|
||||
const randomStr = Math.random().toString(36).substring(2, 8);
|
||||
return `EVT-${timestamp}-${randomStr}`.toUpperCase();
|
||||
}
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
console.log('[api/events.post] =========================');
|
||||
console.log('[api/events.post] POST /api/events - Create event');
|
||||
@@ -98,8 +107,13 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
const eventsClient = createNocoDBEventsClient();
|
||||
|
||||
// Generate unique event_id
|
||||
const eventId = generateEventId();
|
||||
console.log('[api/events.post] Generated event_id:', eventId);
|
||||
|
||||
// Prepare event data
|
||||
const eventData = {
|
||||
event_id: eventId, // Add the business identifier
|
||||
title: body.title.trim(),
|
||||
description: body.description?.trim() || '',
|
||||
event_type: body.event_type as 'meeting' | 'social' | 'fundraiser' | 'workshop' | 'board-only',
|
||||
|
||||
Reference in New Issue
Block a user