This commit is contained in:
@@ -166,7 +166,7 @@ export const useEvents = () => {
|
||||
error.value = null;
|
||||
|
||||
try {
|
||||
const response = await $fetch(`/api/events/${eventId}/attendees`, {
|
||||
const response = await $fetch<{ success: boolean; data?: any; message: string }>(`/api/events/${eventId}/attendees`, {
|
||||
method: 'PATCH',
|
||||
body: {
|
||||
event_id: eventId,
|
||||
@@ -187,7 +187,8 @@ export const useEvents = () => {
|
||||
}
|
||||
}
|
||||
|
||||
return response.data;
|
||||
// Return data if available, otherwise return success status
|
||||
return response.data || { success: true, message: response.message };
|
||||
} else {
|
||||
throw new Error(response.message || 'Failed to update attendance');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user