From 60c99e06505408132432b57ff00f167a9b978342 Mon Sep 17 00:00:00 2001 From: Dominik Stahl Date: Mon, 16 Jun 2025 11:09:43 +0200 Subject: [PATCH] feat(api): add tags to event and user routes for better categorization --- docker-compose.yml | 1 + src/app/api/event/[eventID]/participant/[user]/route.ts | 6 ++++++ src/app/api/event/[eventID]/participant/route.ts | 4 ++++ src/app/api/event/[eventID]/route.ts | 6 ++++++ src/app/api/event/route.ts | 4 ++++ src/app/api/user/[user]/route.ts | 2 ++ src/app/api/user/me/route.ts | 4 ++++ src/app/home/page.tsx | 2 +- 8 files changed, 28 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index cee59f7..2412d46 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,7 @@ services: build: context: . dockerfile: Dockerfile + network: host image: git.dominikstahl.dev/dhbw-we/meetup:main ports: - '3000:3000' diff --git a/src/app/api/event/[eventID]/participant/[user]/route.ts b/src/app/api/event/[eventID]/participant/[user]/route.ts index 91e818a..2426c49 100644 --- a/src/app/api/event/[eventID]/participant/[user]/route.ts +++ b/src/app/api/event/[eventID]/participant/[user]/route.ts @@ -8,6 +8,8 @@ import { NextResponse } from 'next/server'; * get: * summary: Get a specific participant's details in an event * description: Returns the details of a specific participant in an event. + * tags: + * - Event_Participant * parameters: * - in: path * name: eventID @@ -150,6 +152,8 @@ export const GET = auth(async (req, { params }) => { * delete: * summary: Remove a participant from an event * description: Removes a participant from an event. Only the organizer can remove participants. + * tags: + * - Event_Participant * parameters: * - in: path * name: eventID @@ -282,6 +286,8 @@ export const DELETE = auth(async (req, { params }) => { * patch: * summary: Update a participant's status in an event * description: Updates the status of a participant in an event. Only the participant can update their own status. + * tags: + * - Event_Participant * parameters: * - in: path * name: eventID diff --git a/src/app/api/event/[eventID]/participant/route.ts b/src/app/api/event/[eventID]/participant/route.ts index 967f377..bee8340 100644 --- a/src/app/api/event/[eventID]/participant/route.ts +++ b/src/app/api/event/[eventID]/participant/route.ts @@ -8,6 +8,8 @@ import { NextResponse } from 'next/server'; * get: * summary: Get participants of an event * description: Returns all participants of a specific event. + * tags: + * - Event_Participant * parameters: * - in: path * name: eventID @@ -135,6 +137,8 @@ export const GET = auth(async (req, { params }) => { * post: * summary: Add a participant to an event * description: Adds a user as a participant to a specific event. + * tags: + * - Event_Participant * parameters: * - in: path * name: eventID diff --git a/src/app/api/event/[eventID]/route.ts b/src/app/api/event/[eventID]/route.ts index a5bb40c..6798192 100644 --- a/src/app/api/event/[eventID]/route.ts +++ b/src/app/api/event/[eventID]/route.ts @@ -8,6 +8,8 @@ import { NextResponse } from 'next/server'; * get: * summary: Get details of a specific event * description: Returns the details of an event by its ID. + * tags: + * - Event * parameters: * - in: path * name: eventID @@ -125,6 +127,8 @@ export const GET = auth(async (req, { params }) => { * delete: * summary: Delete a specific event * description: Deletes an event by its ID if the user is the organizer. + * tags: + * - Event * parameters: * - in: path * name: eventID @@ -234,6 +238,8 @@ export const DELETE = auth(async (req, { params }) => { * patch: * summary: Update a specific event * description: Updates an event by its ID if the user is the organizer. + * tags: + * - Event * parameters: * - in: path * name: eventID diff --git a/src/app/api/event/route.ts b/src/app/api/event/route.ts index 734ab1c..e825c47 100644 --- a/src/app/api/event/route.ts +++ b/src/app/api/event/route.ts @@ -8,6 +8,8 @@ import { NextResponse } from 'next/server'; * get: * summary: Get all events for the authenticated user * description: Returns all events where the user is an organizer or a participant. + * tags: + * - Event * responses: * 200: * description: List of events for the user. @@ -110,6 +112,8 @@ export const GET = auth(async (req) => { * post: * summary: Create a new event * description: Creates a new event as the authenticated user (organizer). + * tags: + * - Event * requestBody: * required: true * content: diff --git a/src/app/api/user/[user]/route.ts b/src/app/api/user/[user]/route.ts index ba9844e..4b515cc 100644 --- a/src/app/api/user/[user]/route.ts +++ b/src/app/api/user/[user]/route.ts @@ -8,6 +8,8 @@ import { prisma } from '@/prisma'; * get: * summary: Get user information by ID or name * description: Retrieve the information of a specific user by ID or name. + * tags: + * - User * parameters: * - in: path * name: user diff --git a/src/app/api/user/me/route.ts b/src/app/api/user/me/route.ts index 1a2d665..12ceddf 100644 --- a/src/app/api/user/me/route.ts +++ b/src/app/api/user/me/route.ts @@ -15,6 +15,8 @@ import { * get: * summary: Get the currently authenticated user's information * description: Retrieve the information of the currently authenticated user. + * tags: + * - User * responses: * 200: * description: User information retrieved successfully. @@ -89,6 +91,8 @@ export const GET = auth(async function GET(req) { * patch: * summary: Update the currently authenticated user's information * description: Update the information of the currently authenticated user. + * tags: + * - User * requestBody: * required: true * content: diff --git a/src/app/home/page.tsx b/src/app/home/page.tsx index 628f236..0ede283 100644 --- a/src/app/home/page.tsx +++ b/src/app/home/page.tsx @@ -2,7 +2,7 @@ import { RedirectButton } from '@/components/user/redirect-button'; import { ThemePicker } from '@/components/user/theme-picker'; -import { useGetApiUserMe } from '@/generated/api/default/default'; +import { useGetApiUserMe } from '@/generated/api/user/user'; export default function Home() { const { data, isLoading } = useGetApiUserMe();