fix: remove non-existent GET persons endpoint from crowd list detail panel
The backend only has POST (add) and DELETE (remove) for crowd list persons — no GET to list them. Reworked the detail panel to show person count from the crowd list data instead of fetching individual persons. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,6 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/vue-query'
|
||||
import type { Ref } from 'vue'
|
||||
import { apiClient } from '@/lib/axios'
|
||||
import type { CrowdList, CreateCrowdListDto, UpdateCrowdListDto } from '@/types/crowdList'
|
||||
import type { Person } from '@/types/person'
|
||||
|
||||
interface ApiResponse<T> {
|
||||
success: boolean
|
||||
@@ -24,20 +23,6 @@ export function useCrowdLists(eventId: Ref<string>) {
|
||||
})
|
||||
}
|
||||
|
||||
export function useCrowdListPersons(eventId: Ref<string>, listId: Ref<string>) {
|
||||
return useQuery({
|
||||
queryKey: ['crowd-lists', eventId, 'persons', listId],
|
||||
queryFn: async () => {
|
||||
const { data } = await apiClient.get<{ data: Person[] }>(
|
||||
`/events/${eventId.value}/crowd-lists/${listId.value}/persons`,
|
||||
)
|
||||
|
||||
return data.data
|
||||
},
|
||||
enabled: () => !!eventId.value && !!listId.value,
|
||||
})
|
||||
}
|
||||
|
||||
export function useCreateCrowdList(eventId: Ref<string>) {
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user