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,21 @@
import { Prisma } from "@prisma/client";
import { AppError } from "../../../helpers/error/instances/app";
import { prisma } from "../../../utils/databases/prisma/connection";
import { generateUUIDv7 } from "../../../helpers/databases/uuidv7";
import { SystemAccountId } from "../../../config/account/system";
export const insertHeroBannerRepository = async (
payload: Omit<Prisma.HeroBannerCreateInput, "id" | "createdBy">,
) => {
try {
return await prisma.heroBanner.create({
data: {
id: generateUUIDv7(),
creatorId: SystemAccountId,
...payload,
},
});
} catch (error) {
throw new AppError(500, "Failed to insert hero banner", error);
}
};