feat: endpoint for create video service

This commit is contained in:
2026-01-30 15:18:00 +07:00
parent 0521c27834
commit ab0c8afca4
6 changed files with 83 additions and 1 deletions

View File

@ -0,0 +1,32 @@
import { Context } from "elysia";
import { mainErrorHandler } from "../../../helpers/error/handler";
import { returnWriteResponse } from "../../../helpers/callback/httpResponse";
import { createVideoServiceInternalService } from "../services/http/createVideoService.service";
export interface CreateVideoServiceBodyRequest {
name: string;
domain: string;
logo: string;
hexColor: string;
endpointVideo: string;
endpointThumbnail: string;
endpointDownload?: string;
}
export const createVideoServiceInternalController = async (
ctx: Context & { body: CreateVideoServiceBodyRequest },
) => {
try {
const createdVideoService = await createVideoServiceInternalService(
ctx.body,
);
return returnWriteResponse(
ctx.set,
201,
"Video service created",
createdVideoService,
);
} catch (error) {
throw mainErrorHandler(ctx.set, error);
}
};