import {db} from '@/lib/db/prisma/client'

export const getAllOrders = async () => {
	return db.order.findMany({
		orderBy: [
			{
				createdAt: 'desc'
			}
		]
	})
}

export const getOrdersByUserId = async (userId: number) => {
	return db.order.findMany({
		where: {
			userId
		},
		orderBy: [
			{
				createdAt: 'desc'
			}
		]
	})
}
