fix: submissions module constructs its own VideoService (root-module provider not importable)

This commit is contained in:
glass beadian 2026-10-14 13:45:15 +00:00
parent b4ff73ffa8
commit 71ccc1db75

View file

@ -14,14 +14,17 @@ import { SUBMISSION_DEPS, SubmissionsService } from "./submissions.service.js";
providers: [
SubmissionsService,
{
// VideoService is registered in the root module's providers, not a
// feature module — construct our own (stateless over the pool + S3).
provide: SUBMISSION_DEPS,
useFactory: (video: VideoService | null) => ({
storage: null,
videoUpload: video === null
? null
: (workspaceId: string, storageKey: string, mimeType: string, sizeBytes: number) => video.uploadVideo(workspaceId, storageKey, mimeType, sizeBytes),
}),
inject: [VideoService],
useFactory: () => {
const video = new VideoService();
return {
storage: null,
videoUpload: (workspaceId: string, storageKey: string, mimeType: string, sizeBytes: number) =>
video.uploadVideo(workspaceId, storageKey, mimeType, sizeBytes),
};
},
},
],
exports: [SubmissionsService],