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 {
AreaListResponse, CategoryListResponse, CreateAreaRequest, CreateCategoryRequest, CreateTeamRequest,
AreaListResponse,
CategoryListResponse,
CreateAreaRequest,
CreateCategoryRequest,
CreateTeamRequest,
ModerationListResponse,
OkResponse,
OverviewStatsResponse, TeamListResponse, UpdateModerationRequest,
UpdateAreaRequest, UpdateCategoryRequest, UpdateTeamRequest,
UpdateUserBanRequest, UpdateUserRolesRequest,
OverviewStatsResponse,
UpdateAreaRequest,
UpdateCategoryRequest,
UpdateModerationRequest,
UpdateTeamRequest,
UpdateUserBanRequest,
UpdateUserRolesRequest,
UserListResponse
} from "~/types/api";
@@ -45,9 +53,6 @@ export const useAdmin = () => {
const deleteCategory = (id: number) =>
useApiFetch<OkResponse>(`/api/v1/admin/categories/${id}`, { method: 'DELETE' })
const getTeams = () =>
useApiFetch<TeamListResponse>('/api/v1/admin/teams', { method: 'GET' })
const createTeam = (body: CreateTeamRequest) =>
useApiFetch<OkResponse>('/api/v1/admin/teams', { method: 'POST', body })
@@ -76,7 +81,6 @@ export const useAdmin = () => {
createCategory,
updateCategory,
deleteCategory,
getTeams,
createTeam,
updateTeam,
deleteTeam,
+2 -1
View File
@@ -8,8 +8,9 @@ definePageMeta({
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 { getTeams } = useOperator()
const { data: categoriesRes, refresh: refreshCategories } = await useAsyncData('report-categories-admin-view', () => getCategories())
const { data: teamsRes, refresh: refreshTeams } = await useAsyncData('admin-teams', () => getTeams())