Fix some endpoint paths
This commit is contained in:
parent
b0bbc7e81a
commit
0f820d12e3
|
@ -141,7 +141,7 @@ async def get_event_categories(event_id: PydanticObjectId, user: CurrentUserDep)
|
||||||
return [CategoryData.from_category(category) for category in cast(list[Category], event.categories)]
|
return [CategoryData.from_category(category) for category in cast(list[Category], event.categories)]
|
||||||
|
|
||||||
|
|
||||||
@categories_router.get("{category_id}")
|
@categories_router.get("/{category_id}")
|
||||||
async def get_category(category_id: PydanticObjectId, user: CurrentUserDep) -> CategoryData:
|
async def get_category(category_id: PydanticObjectId, user: CurrentUserDep) -> CategoryData:
|
||||||
"""Get a category by ID."""
|
"""Get a category by ID."""
|
||||||
category = await Category.get(category_id, fetch_links=True)
|
category = await Category.get(category_id, fetch_links=True)
|
||||||
|
@ -156,7 +156,7 @@ async def get_category(category_id: PydanticObjectId, user: CurrentUserDep) -> C
|
||||||
return CategoryData.from_category(category)
|
return CategoryData.from_category(category)
|
||||||
|
|
||||||
|
|
||||||
@categories_router.delete("{category_id}")
|
@categories_router.delete("/{category_id}")
|
||||||
async def delete_category(category_id: PydanticObjectId, user: CurrentUserDep) -> Response:
|
async def delete_category(category_id: PydanticObjectId, user: CurrentUserDep) -> Response:
|
||||||
"""Delete the given category.
|
"""Delete the given category.
|
||||||
|
|
||||||
|
@ -196,7 +196,7 @@ async def create_category(
|
||||||
return CategoryData.from_category(category)
|
return CategoryData.from_category(category)
|
||||||
|
|
||||||
|
|
||||||
@categories_router.put("{category_id}")
|
@categories_router.put("/{category_id}")
|
||||||
async def overwrite_category(
|
async def overwrite_category(
|
||||||
category_id: PydanticObjectId,
|
category_id: PydanticObjectId,
|
||||||
user: CurrentUserDep,
|
user: CurrentUserDep,
|
||||||
|
@ -216,7 +216,7 @@ async def overwrite_category(
|
||||||
return CategoryData.from_category(category)
|
return CategoryData.from_category(category)
|
||||||
|
|
||||||
|
|
||||||
@categories_router.patch("{category_id}")
|
@categories_router.patch("/{category_id}")
|
||||||
async def update_category(
|
async def update_category(
|
||||||
category_id: PydanticObjectId,
|
category_id: PydanticObjectId,
|
||||||
user: CurrentUserDep,
|
user: CurrentUserDep,
|
||||||
|
|
|
@ -235,7 +235,7 @@ async def get_user_invited_events(
|
||||||
return [EventData.from_event(event) for event in events]
|
return [EventData.from_event(event) for event in events]
|
||||||
|
|
||||||
|
|
||||||
@events_router.get("{event_id}")
|
@events_router.get("/{event_id}")
|
||||||
async def get_event(event_id: PydanticObjectId, user: CurrentUserDep) -> EventData:
|
async def get_event(event_id: PydanticObjectId, user: CurrentUserDep) -> EventData:
|
||||||
"""Get an event by ID.
|
"""Get an event by ID.
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ async def get_event(event_id: PydanticObjectId, user: CurrentUserDep) -> EventDa
|
||||||
return EventData.from_event(event)
|
return EventData.from_event(event)
|
||||||
|
|
||||||
|
|
||||||
@events_router.delete("{event_id}")
|
@events_router.delete("/{event_id}")
|
||||||
async def delete_event(event_id: PydanticObjectId, user: CurrentUserDep) -> Response:
|
async def delete_event(event_id: PydanticObjectId, user: CurrentUserDep) -> Response:
|
||||||
"""Delete an event by ID."""
|
"""Delete an event by ID."""
|
||||||
event = await Event.get(event_id)
|
event = await Event.get(event_id)
|
||||||
|
@ -287,7 +287,7 @@ async def create_event(
|
||||||
return EventData.from_event(event)
|
return EventData.from_event(event)
|
||||||
|
|
||||||
|
|
||||||
@events_router.put("{event_id}")
|
@events_router.put("/{event_id}")
|
||||||
async def overwrite_event(
|
async def overwrite_event(
|
||||||
event_id: PydanticObjectId,
|
event_id: PydanticObjectId,
|
||||||
user: CurrentUserDep,
|
user: CurrentUserDep,
|
||||||
|
|
|
@ -174,7 +174,7 @@ async def get_user_incomming_invitatinos(user_id: PydanticObjectId, user: Curren
|
||||||
return [InvitationData.from_invitation(invitation) for invitation in invitations]
|
return [InvitationData.from_invitation(invitation) for invitation in invitations]
|
||||||
|
|
||||||
|
|
||||||
@invitations_router.get("{invitation_id}")
|
@invitations_router.get("/{invitation_id}")
|
||||||
async def get_invitation(invitation_id: PydanticObjectId, user: CurrentUserDep) -> InvitationData:
|
async def get_invitation(invitation_id: PydanticObjectId, user: CurrentUserDep) -> InvitationData:
|
||||||
"""Get information about a specific invitation.
|
"""Get information about a specific invitation.
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ async def create_invitation(data: InvitationCreateData, user: CurrentUserDep) ->
|
||||||
return InvitationData.from_invitation(invitation)
|
return InvitationData.from_invitation(invitation)
|
||||||
|
|
||||||
|
|
||||||
@invitations_router.delete("{invitation_id}")
|
@invitations_router.delete("/{invitation_id}")
|
||||||
async def delete_invitation(invitation_id: PydanticObjectId, user: CurrentUserDep) -> Response:
|
async def delete_invitation(invitation_id: PydanticObjectId, user: CurrentUserDep) -> Response:
|
||||||
"""Delete an invitation."""
|
"""Delete an invitation."""
|
||||||
invitation = await Invitation.get(invitation_id, fetch_links=True)
|
invitation = await Invitation.get(invitation_id, fetch_links=True)
|
||||||
|
@ -219,7 +219,7 @@ async def delete_invitation(invitation_id: PydanticObjectId, user: CurrentUserDe
|
||||||
return Response(status.HTTP_204_NO_CONTENT)
|
return Response(status.HTTP_204_NO_CONTENT)
|
||||||
|
|
||||||
|
|
||||||
@invitations_router.post("{invitation_id}/accept")
|
@invitations_router.post("/{invitation_id}/accept")
|
||||||
async def accept_invitation(invitation_id: PydanticObjectId, user: CurrentUserDep) -> Response:
|
async def accept_invitation(invitation_id: PydanticObjectId, user: CurrentUserDep) -> Response:
|
||||||
"""Accept an invitation."""
|
"""Accept an invitation."""
|
||||||
invitation = await Invitation.get(invitation_id, fetch_links=True)
|
invitation = await Invitation.get(invitation_id, fetch_links=True)
|
||||||
|
@ -261,7 +261,7 @@ async def accept_invitation(invitation_id: PydanticObjectId, user: CurrentUserDe
|
||||||
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
return Response(status_code=status.HTTP_204_NO_CONTENT)
|
||||||
|
|
||||||
|
|
||||||
@invitations_router.post("{invitation_id}/decline")
|
@invitations_router.post("/{invitation_id}/decline")
|
||||||
async def decline_invitation(invitation_id: PydanticObjectId, user: CurrentUserDep) -> Response:
|
async def decline_invitation(invitation_id: PydanticObjectId, user: CurrentUserDep) -> Response:
|
||||||
"""Decline an invitation."""
|
"""Decline an invitation."""
|
||||||
invitation = await Invitation.get(invitation_id, fetch_links=True)
|
invitation = await Invitation.get(invitation_id, fetch_links=True)
|
||||||
|
|
|
@ -72,7 +72,7 @@ async def get_user_notifications(user_id: PydanticObjectId, user: CurrentUserDep
|
||||||
return [NotificationData.from_notification(notification) for notification in notifications]
|
return [NotificationData.from_notification(notification) for notification in notifications]
|
||||||
|
|
||||||
|
|
||||||
@notifications_router.get("{notification_id}")
|
@notifications_router.get("/{notification_id}")
|
||||||
async def get_notification(notification_id: PydanticObjectId, user: CurrentUserDep) -> NotificationData:
|
async def get_notification(notification_id: PydanticObjectId, user: CurrentUserDep) -> NotificationData:
|
||||||
"""Get a single notification."""
|
"""Get a single notification."""
|
||||||
notification = await Notification.get(notification_id, fetch_links=True)
|
notification = await Notification.get(notification_id, fetch_links=True)
|
||||||
|
@ -89,7 +89,7 @@ async def get_notification(notification_id: PydanticObjectId, user: CurrentUserD
|
||||||
return NotificationData.from_notification(notification)
|
return NotificationData.from_notification(notification)
|
||||||
|
|
||||||
|
|
||||||
@notifications_router.get("{notification_id}/read")
|
@notifications_router.get("/{notification_id}/read")
|
||||||
async def read_notification(notification_id: PydanticObjectId, user: CurrentUserDep) -> NotificationData:
|
async def read_notification(notification_id: PydanticObjectId, user: CurrentUserDep) -> NotificationData:
|
||||||
"""Mark a notification as read."""
|
"""Mark a notification as read."""
|
||||||
notification = await Notification.get(notification_id, fetch_links=True)
|
notification = await Notification.get(notification_id, fetch_links=True)
|
||||||
|
|
Loading…
Reference in a new issue