Skip to content

Commit 5207316

Browse files
committed
fix: endpoints fixes
1 parent d2452da commit 5207316

5 files changed

Lines changed: 12 additions & 31 deletions

File tree

projects/api/src/contracts/_internal/response/listMetadataResponseSchema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ export const listMetadataResponseSchema = z.object({
55
id: z.number().int(),
66
listed_at: z.string().datetime(),
77
notes: z.string().nullish(),
8+
my_rating: z.number().int().nullish(),
89
});

projects/api/src/contracts/users/schema/response/favoritedMoviesResponseSchema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ export const favoritedMoviesResponseSchema = z.object({
66
listed_at: z.string().datetime(),
77
notes: z.string().nullish(),
88
rank: z.number().int(),
9+
my_rating: z.number().int().nullish(),
910
}).merge(typedMovieResponseSchema);

projects/api/src/contracts/users/schema/response/favoritedShowsResponseSchema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ export const favoritedShowsResponseSchema = z.object({
66
listed_at: z.string().datetime(),
77
notes: z.string().nullish(),
88
rank: z.number().int(),
9+
my_rating: z.number().int().nullish(),
910
}).merge(typedShowResponseSchema);
Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,15 @@
11
import { commentResponseSchema } from '../../../_internal/response/commentResponseSchema.ts';
22
import { episodeResponseSchema } from '../../../_internal/response/episodeResponseSchema.ts';
3-
import { typedMovieResponseSchema } from '../../../_internal/response/movieResponseSchema.ts';
4-
import {
5-
showResponseSchema,
6-
typedShowResponseSchema,
7-
} from '../../../_internal/response/showResponseSchema.ts';
3+
import { movieResponseSchema } from '../../../_internal/response/movieResponseSchema.ts';
4+
import { showResponseSchema } from '../../../_internal/response/showResponseSchema.ts';
85
import { z } from '../../../_internal/z.ts';
96
import { seasonResponseSchema } from '../../../shows/schema/response/seasonResponseSchema.ts';
107

11-
const commentedMovieResponseSchema = z.object({
12-
comment: commentResponseSchema,
13-
}).merge(typedMovieResponseSchema);
14-
15-
const commentedShowResponseSchema = z.object({
16-
comment: commentResponseSchema,
17-
}).merge(typedShowResponseSchema);
18-
19-
const commentedSeasonResponseSchema = z.object({
20-
type: z.literal('season'),
21-
season: seasonResponseSchema,
8+
export const userCommentResponseSchema = z.object({
229
comment: commentResponseSchema,
10+
type: z.enum(['movie', 'show', 'season', 'episode']),
11+
movie: movieResponseSchema.optional(),
12+
show: showResponseSchema.optional(),
13+
season: seasonResponseSchema.optional(),
14+
episode: episodeResponseSchema.optional(),
2315
});
24-
25-
const commentedEpisodeResponseSchema = z.object({
26-
type: z.literal('episode'),
27-
episode: episodeResponseSchema,
28-
show: showResponseSchema,
29-
comment: commentResponseSchema,
30-
});
31-
32-
export const userCommentResponseSchema = z.discriminatedUnion('type', [
33-
commentedMovieResponseSchema,
34-
commentedShowResponseSchema,
35-
commentedSeasonResponseSchema,
36-
commentedEpisodeResponseSchema,
37-
]);

projects/api/src/contracts/users/subroutes/userLists.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ Remove one or more items from a personal list.
216216
summary: 'Reorder items on a list',
217217
description: `#### 🔒 OAuth Required
218218
Reorder items on a personal list. Send the ordered list item IDs in the request body; the response returns the updated item order.`,
219-
path: '/reorder',
219+
path: '/items/reorder',
220220
method: 'POST',
221221
pathParams: profileParamsSchema
222222
.merge(listParamsSchema),

0 commit comments

Comments
 (0)