We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d061707 commit bfd47a7Copy full SHA for bfd47a7
1 file changed
apps/web/app/api/upload/[...route]/multipart.ts
@@ -46,11 +46,15 @@ app.post(
46
subpath: "result.mp4",
47
});
48
49
+ const videoIdFromFileKey = fileKey.split("/")[1];
50
+ const videoId = "videoId" in body ? body.videoId : videoIdFromFileKey;
51
+ if (!videoId) throw new Error("Video ID is required");
52
+
53
const resp = await Effect.gen(function* () {
54
const videos = yield* Videos;
55
const db = yield* Database;
56
- const video = yield* videos.getById(Video.VideoId.make(user.id));
57
+ const video = yield* videos.getById(Video.VideoId.make(videoId));
58
if (Option.isNone(video)) return yield* new Video.NotFoundError();
59
60
yield* db.use((db) =>
0 commit comments