fix(api): update paths in Swagger documentation to include '/api' prefix
Some checks failed
container-scan / Container Scan (pull_request) Failing after 31s
docker-build / docker (pull_request) Failing after 4m46s

This commit is contained in:
Dominik 2025-06-19 20:29:04 +02:00
parent eef17c5360
commit a36ea0cb6b
Signed by: dominik
GPG key ID: 06A4003FC5049644
4 changed files with 29 additions and 10 deletions

View file

@ -19,7 +19,7 @@ import {
export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
registry.registerPath({
method: 'get',
path: '/event/{eventID}/participant/{user}',
path: '/api/event/{eventID}/participant/{user}',
request: {
params: zod.object({
eventID: EventIdParamSchema,
@ -44,7 +44,7 @@ export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
registry.registerPath({
method: 'delete',
path: '/event/{eventID}/participant/{user}',
path: '/api/event/{eventID}/participant/{user}',
request: {
params: zod.object({
eventID: EventIdParamSchema,
@ -69,7 +69,7 @@ export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
registry.registerPath({
method: 'patch',
path: '/event/{eventID}/participant/{user}',
path: '/api/event/{eventID}/participant/{user}',
request: {
params: zod.object({
eventID: EventIdParamSchema,

View file

@ -16,7 +16,7 @@ import { EventIdParamSchema } from '@/app/api/validation';
export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
registry.registerPath({
method: 'get',
path: '/event/{eventID}/participant',
path: '/api/event/{eventID}/participant',
request: {
params: zod.object({
eventID: EventIdParamSchema,
@ -40,7 +40,7 @@ export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
registry.registerPath({
method: 'post',
path: '/event/{eventID}/participant',
path: '/api/event/{eventID}/participant',
request: {
params: zod.object({
eventID: EventIdParamSchema,

View file

@ -219,8 +219,15 @@ export const PATCH = auth(async (req, { params }) => {
{ status: 400 },
);
}
const { title, description, start_time, end_time, location, status } =
data.data;
const {
title,
description,
start_time,
end_time,
location,
status,
participants,
} = data.data;
const updatedEvent = await prisma.meeting.update({
where: {
@ -233,6 +240,18 @@ export const PATCH = auth(async (req, { params }) => {
end_time,
location,
status,
participants: !participants
? undefined
: {
deleteMany: {
user_id: {
notIn: participants,
},
},
create: participants.map((participant) => ({
user_id: participant,
})),
},
},
select: {
id: true,

View file

@ -15,7 +15,7 @@ import zod from 'zod/v4';
export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
registry.registerPath({
method: 'get',
path: '/event/{eventID}',
path: '/api/event/{eventID}',
request: {
params: zod.object({
eventID: EventIdParamSchema,
@ -38,7 +38,7 @@ export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
registry.registerPath({
method: 'delete',
path: '/event/{eventID}',
path: '/api/event/{eventID}',
request: {
params: zod.object({
eventID: EventIdParamSchema,
@ -62,7 +62,7 @@ export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
registry.registerPath({
method: 'patch',
path: '/event/{eventID}',
path: '/api/event/{eventID}',
request: {
params: zod.object({
eventID: EventIdParamSchema,