feat: add internal endpoint to create banner

This commit is contained in:
2026-03-02 22:09:33 +07:00
parent 90655dcf92
commit 960493f414
6 changed files with 81 additions and 2 deletions

View File

@ -0,0 +1,24 @@
import { Context } from "elysia";
import { mainErrorHandler } from "../../../helpers/error/handler";
import { createHeroBannerService } from "../services/http/createHeroBanner.service";
export interface CreateHeroBannerRequestBody {
isClickable?: boolean;
title?: string;
description?: string;
buttonContent?: string;
buttonLink?: string;
imageUrl?: string;
startDate: string;
endDate: string;
}
export const createHeroBannerController = async (
ctx: Context & { body: CreateHeroBannerRequestBody },
) => {
try {
return await createHeroBannerService(ctx.body);
} catch (error) {
return mainErrorHandler(ctx.set, error);
}
};