import { factories } from "@strapi/strapi";

const POPULATE = {
  hero: { populate: { videoUrl_16x9: true } },
  gallery: {
    populate: {
      images: { populate: { image_3x2: true } },
    },
  },
  inquiry: { populate: { image_1x1: true, eventTypes: true, eventBudgets: true } },
};

export default factories.createCoreController("api::wedding-collective.wedding-collective", () => ({
  async find(ctx) {
    const data = await strapi
      .documents("api::wedding-collective.wedding-collective")!
      .findFirst({ populate: POPULATE });
    return this.transformResponse(data);
  },
}));
