fix: change GET /teams endpoint

This commit is contained in:
2026-06-18 01:07:19 +02:00 Unverified
parent e75aa2b173
commit 83aa3baddb
2 changed files with 14 additions and 9 deletions
+12 -8
View File
@@ -1,10 +1,18 @@
import type { import type {
AreaListResponse, CategoryListResponse, CreateAreaRequest, CreateCategoryRequest, CreateTeamRequest, AreaListResponse,
CategoryListResponse,
CreateAreaRequest,
CreateCategoryRequest,
CreateTeamRequest,
ModerationListResponse, ModerationListResponse,
OkResponse, OkResponse,
OverviewStatsResponse, TeamListResponse, UpdateModerationRequest, OverviewStatsResponse,
UpdateAreaRequest, UpdateCategoryRequest, UpdateTeamRequest, UpdateAreaRequest,
UpdateUserBanRequest, UpdateUserRolesRequest, UpdateCategoryRequest,
UpdateModerationRequest,
UpdateTeamRequest,
UpdateUserBanRequest,
UpdateUserRolesRequest,
UserListResponse UserListResponse
} from "~/types/api"; } from "~/types/api";
@@ -45,9 +53,6 @@ export const useAdmin = () => {
const deleteCategory = (id: number) => const deleteCategory = (id: number) =>
useApiFetch<OkResponse>(`/api/v1/admin/categories/${id}`, { method: 'DELETE' }) useApiFetch<OkResponse>(`/api/v1/admin/categories/${id}`, { method: 'DELETE' })
const getTeams = () =>
useApiFetch<TeamListResponse>('/api/v1/admin/teams', { method: 'GET' })
const createTeam = (body: CreateTeamRequest) => const createTeam = (body: CreateTeamRequest) =>
useApiFetch<OkResponse>('/api/v1/admin/teams', { method: 'POST', body }) useApiFetch<OkResponse>('/api/v1/admin/teams', { method: 'POST', body })
@@ -76,7 +81,6 @@ export const useAdmin = () => {
createCategory, createCategory,
updateCategory, updateCategory,
deleteCategory, deleteCategory,
getTeams,
createTeam, createTeam,
updateTeam, updateTeam,
deleteTeam, deleteTeam,
+2 -1
View File
@@ -8,8 +8,9 @@ definePageMeta({
useHead({ title: 'Categorie e Team - Admin' }) useHead({ title: 'Categorie e Team - Admin' })
const { createCategory, updateCategory, deleteCategory, getTeams, createTeam, updateTeam, deleteTeam, getAreas } = useAdmin() const { createCategory, updateCategory, deleteCategory, createTeam, updateTeam, deleteTeam, getAreas } = useAdmin()
const { getCategories } = useReports() const { getCategories } = useReports()
const { getTeams } = useOperator()
const { data: categoriesRes, refresh: refreshCategories } = await useAsyncData('report-categories-admin-view', () => getCategories()) const { data: categoriesRes, refresh: refreshCategories } = await useAsyncData('report-categories-admin-view', () => getCategories())
const { data: teamsRes, refresh: refreshTeams } = await useAsyncData('admin-teams', () => getTeams()) const { data: teamsRes, refresh: refreshTeams } = await useAsyncData('admin-teams', () => getTeams())