import BoardChannel from '../../models/boardChannel.js'
import { requireAuth } from '../../utils/auth.js'

export default defineEventHandler(async (event) => {
  await requireAuth(event)

  const channels = await BoardChannel.find({}).sort({ name: 1 }).lean()

  return { channels }
})
