feat: add suggested team

This commit is contained in:
2026-06-19 21:54:05 +02:00 Unverified
parent d0ca932edb
commit 0944ccec8c
3 changed files with 96 additions and 36 deletions
+2 -2
View File
@@ -70,8 +70,8 @@ export const useAuth = () => {
const res = await fetchCurrentUser()
if (res.ok) {
user.value = res.user
await refreshUnreadNotifications()
const path = currentPath ?? useNuxtApp().$router.currentRoute.value.path
await nuxtApp.runWithContext(() => refreshUnreadNotifications())
const path = currentPath ?? nuxtApp.$router.currentRoute.value.path
if (redirectOnSuccess && path.startsWith('/auth')) {
await nuxtApp.runWithContext(() => navigateTo('/dashboard'))
+15 -5
View File
@@ -1,11 +1,17 @@
import type {
CategoryListResponse,
CreateReportRequest,
CreateReportResponse, FeedbackRequest, FlagRequest, FlagResponse,
CreateReportResponse,
FeedbackRequest,
FlagRequest,
FlagResponse,
MediaUploadResponse,
MessageListResponse, MessageRequest, OkResponse,
MessageListResponse,
MessageRequest,
OkResponse,
ReportDetailResponse,
ReportListResponse
ReportListResponse,
TeamListResponse
} from "~/types/api";
export const useReports = () => {
@@ -20,7 +26,7 @@ export const useReports = () => {
const getReportDetail = (id: number) =>
useApiFetch<ReportDetailResponse>(`/api/v1/reports/${id}`, { method: 'GET' })
const uploadMedia = (id: number, formData: FormData) =>
useApiFetch<MediaUploadResponse>(`/api/v1/reports/${id}/media`, { method: 'POST', body: formData })
@@ -39,6 +45,9 @@ export const useReports = () => {
const flagMessage = (reportId: number, messageId: number, body: FlagRequest) =>
useApiFetch<FlagResponse>(`/api/v1/reports/${reportId}/messages/${messageId}/flags`, { method: 'POST', body })
const getTeamSuggestions = (id: number) =>
useApiFetch<TeamListResponse>(`/api/v1/reports/${id}/team-suggestions`, { method: 'GET' })
return {
getReports,
getCategories,
@@ -50,5 +59,6 @@ export const useReports = () => {
addFeedback,
flagReport,
flagMessage,
getTeamSuggestions,
}
}
}