'use server'

import {CategoryLocale} from '@prisma/client'

import {STORE_ID} from '@/lib/config/constants'
import {db} from '@/lib/db/prisma/client'

export const getCategoryBySlug = async (slug: string) => {
	return db.categoryLocale.findFirst({
		where: {
			slug
		},
		select: {
			category: {
				include: {
					locales: true,
					categoriesOnProducts: true
				}
			}
		}
	})
}
