88 selectMdxCompiledShowSchema ,
99 selectShowSchema ,
1010 selectSubscriptionSchema ,
11- subscriptionWithShowSchema ,
1211 updateShowSchema
1312} from '@/db/show.schema'
1413import {
@@ -33,7 +32,7 @@ const showWithHostsSchema = selectShowSchema
3332 . openapi ( 'ShowWithHosts' )
3433
3534export const getAllShows = createRoute ( {
36- path : '/shows ' ,
35+ path : '/' ,
3736 method : 'get' ,
3837 request : {
3938 query : paginationQuerySchema
@@ -52,7 +51,7 @@ export const getAllShows = createRoute({
5251} )
5352
5453export const getShowBySlug = createRoute ( {
55- path : '/shows/ {slug}' ,
54+ path : '/{slug}' ,
5655 method : 'get' ,
5756 request : {
5857 params : z . object ( {
@@ -77,7 +76,7 @@ export const getShowBySlug = createRoute({
7776} )
7877
7978export const createShow = createRoute ( {
80- path : '/shows ' ,
79+ path : '/' ,
8180 method : 'post' ,
8281 middleware : [ betterAuthMiddleware ] ,
8382 request : {
@@ -109,7 +108,7 @@ export const createShow = createRoute({
109108} )
110109
111110export const updateShowBySlug = createRoute ( {
112- path : '/shows/ {slug}' ,
111+ path : '/{slug}' ,
113112 method : 'patch' ,
114113 middleware : [ betterAuthMiddleware ] ,
115114 request : {
@@ -140,7 +139,7 @@ export const updateShowBySlug = createRoute({
140139} )
141140
142141export const deleteShowBySlug = createRoute ( {
143- path : '/shows/ {slug}' ,
142+ path : '/{slug}' ,
144143 method : 'delete' ,
145144 middleware : [ betterAuthMiddleware ] ,
146145 request : {
@@ -169,7 +168,7 @@ export const deleteShowBySlug = createRoute({
169168} )
170169
171170export const getShowEpisodes = createRoute ( {
172- path : '/shows/ {slug}/episodes' ,
171+ path : '/{slug}/episodes' ,
173172 method : 'get' ,
174173 request : {
175174 params : z . object ( {
@@ -195,7 +194,7 @@ export const getShowEpisodes = createRoute({
195194} )
196195
197196export const subscribeToShow = createRoute ( {
198- path : '/shows/ {id}/subscribe' ,
197+ path : '/{id}/subscribe' ,
199198 method : 'post' ,
200199 middleware : [ betterAuthMiddleware ] ,
201200 request : {
@@ -225,7 +224,7 @@ export const subscribeToShow = createRoute({
225224} )
226225
227226export const unsubscribeFromShow = createRoute ( {
228- path : '/shows/ {id}/unsubscribe' ,
227+ path : '/{id}/unsubscribe' ,
229228 method : 'delete' ,
230229 middleware : [ betterAuthMiddleware ] ,
231230 request : {
@@ -253,30 +252,6 @@ export const unsubscribeFromShow = createRoute({
253252 }
254253} )
255254
256- export const getUserSubscriptions = createRoute ( {
257- path : '/user/subscriptions' ,
258- method : 'get' ,
259- middleware : [ betterAuthMiddleware ] ,
260- request : {
261- query : paginationQuerySchema
262- } ,
263- tags,
264- responses : {
265- [ HttpStatusCodes . OK ] : jsonContent (
266- createPaginatedResponseSchema ( subscriptionWithShowSchema ) ,
267- 'User subscriptions'
268- ) ,
269- [ HttpStatusCodes . UNAUTHORIZED ] : jsonContent (
270- z . object ( { error : z . string ( ) } ) ,
271- 'Unauthorized'
272- ) ,
273- [ HttpStatusCodes . INTERNAL_SERVER_ERROR ] : jsonContent (
274- z . object ( { error : z . string ( ) } ) ,
275- 'Failed to fetch subscriptions'
276- )
277- }
278- } )
279-
280255export type GetAllShowsRoute = typeof getAllShows
281256export type GetShowBySlugRoute = typeof getShowBySlug
282257export type CreateShowRoute = typeof createShow
@@ -285,4 +260,3 @@ export type DeleteShowBySlugRoute = typeof deleteShowBySlug
285260export type GetShowEpisodesRoute = typeof getShowEpisodes
286261export type SubscribeToShowRoute = typeof subscribeToShow
287262export type UnsubscribeFromShowRoute = typeof unsubscribeFromShow
288- export type GetUserSubscriptionsRoute = typeof getUserSubscriptions
0 commit comments