fix(api): update paths in Swagger documentation to include '/api' prefix
This commit is contained in:
parent
eef17c5360
commit
a36ea0cb6b
4 changed files with 29 additions and 10 deletions
|
@ -19,7 +19,7 @@ import {
|
||||||
export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
||||||
registry.registerPath({
|
registry.registerPath({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
path: '/event/{eventID}/participant/{user}',
|
path: '/api/event/{eventID}/participant/{user}',
|
||||||
request: {
|
request: {
|
||||||
params: zod.object({
|
params: zod.object({
|
||||||
eventID: EventIdParamSchema,
|
eventID: EventIdParamSchema,
|
||||||
|
@ -44,7 +44,7 @@ export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
||||||
|
|
||||||
registry.registerPath({
|
registry.registerPath({
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
path: '/event/{eventID}/participant/{user}',
|
path: '/api/event/{eventID}/participant/{user}',
|
||||||
request: {
|
request: {
|
||||||
params: zod.object({
|
params: zod.object({
|
||||||
eventID: EventIdParamSchema,
|
eventID: EventIdParamSchema,
|
||||||
|
@ -69,7 +69,7 @@ export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
||||||
|
|
||||||
registry.registerPath({
|
registry.registerPath({
|
||||||
method: 'patch',
|
method: 'patch',
|
||||||
path: '/event/{eventID}/participant/{user}',
|
path: '/api/event/{eventID}/participant/{user}',
|
||||||
request: {
|
request: {
|
||||||
params: zod.object({
|
params: zod.object({
|
||||||
eventID: EventIdParamSchema,
|
eventID: EventIdParamSchema,
|
||||||
|
|
|
@ -16,7 +16,7 @@ import { EventIdParamSchema } from '@/app/api/validation';
|
||||||
export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
||||||
registry.registerPath({
|
registry.registerPath({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
path: '/event/{eventID}/participant',
|
path: '/api/event/{eventID}/participant',
|
||||||
request: {
|
request: {
|
||||||
params: zod.object({
|
params: zod.object({
|
||||||
eventID: EventIdParamSchema,
|
eventID: EventIdParamSchema,
|
||||||
|
@ -40,7 +40,7 @@ export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
||||||
|
|
||||||
registry.registerPath({
|
registry.registerPath({
|
||||||
method: 'post',
|
method: 'post',
|
||||||
path: '/event/{eventID}/participant',
|
path: '/api/event/{eventID}/participant',
|
||||||
request: {
|
request: {
|
||||||
params: zod.object({
|
params: zod.object({
|
||||||
eventID: EventIdParamSchema,
|
eventID: EventIdParamSchema,
|
||||||
|
|
|
@ -219,8 +219,15 @@ export const PATCH = auth(async (req, { params }) => {
|
||||||
{ status: 400 },
|
{ status: 400 },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const { title, description, start_time, end_time, location, status } =
|
const {
|
||||||
data.data;
|
title,
|
||||||
|
description,
|
||||||
|
start_time,
|
||||||
|
end_time,
|
||||||
|
location,
|
||||||
|
status,
|
||||||
|
participants,
|
||||||
|
} = data.data;
|
||||||
|
|
||||||
const updatedEvent = await prisma.meeting.update({
|
const updatedEvent = await prisma.meeting.update({
|
||||||
where: {
|
where: {
|
||||||
|
@ -233,6 +240,18 @@ export const PATCH = auth(async (req, { params }) => {
|
||||||
end_time,
|
end_time,
|
||||||
location,
|
location,
|
||||||
status,
|
status,
|
||||||
|
participants: !participants
|
||||||
|
? undefined
|
||||||
|
: {
|
||||||
|
deleteMany: {
|
||||||
|
user_id: {
|
||||||
|
notIn: participants,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
create: participants.map((participant) => ({
|
||||||
|
user_id: participant,
|
||||||
|
})),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
|
|
|
@ -15,7 +15,7 @@ import zod from 'zod/v4';
|
||||||
export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
||||||
registry.registerPath({
|
registry.registerPath({
|
||||||
method: 'get',
|
method: 'get',
|
||||||
path: '/event/{eventID}',
|
path: '/api/event/{eventID}',
|
||||||
request: {
|
request: {
|
||||||
params: zod.object({
|
params: zod.object({
|
||||||
eventID: EventIdParamSchema,
|
eventID: EventIdParamSchema,
|
||||||
|
@ -38,7 +38,7 @@ export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
||||||
|
|
||||||
registry.registerPath({
|
registry.registerPath({
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
path: '/event/{eventID}',
|
path: '/api/event/{eventID}',
|
||||||
request: {
|
request: {
|
||||||
params: zod.object({
|
params: zod.object({
|
||||||
eventID: EventIdParamSchema,
|
eventID: EventIdParamSchema,
|
||||||
|
@ -62,7 +62,7 @@ export default function registerSwaggerPaths(registry: OpenAPIRegistry) {
|
||||||
|
|
||||||
registry.registerPath({
|
registry.registerPath({
|
||||||
method: 'patch',
|
method: 'patch',
|
||||||
path: '/event/{eventID}',
|
path: '/api/event/{eventID}',
|
||||||
request: {
|
request: {
|
||||||
params: zod.object({
|
params: zod.object({
|
||||||
eventID: EventIdParamSchema,
|
eventID: EventIdParamSchema,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue