import { authenticate } from '../../plugins/auth.js'
import { getAnonymityConfig, getSensitivityConfig } from '../../services/config.service.js'

export const sharedConfigRoutes = async (app) => {
  app.get('/anonymity', async (request, reply) => {
    const config = await getAnonymityConfig()
    return reply.send({ success: true, data: config })
  })

  app.get('/sensitivity', { preHandler: [authenticate] }, async (request, reply) => {
    const config = await getSensitivityConfig()
    return reply.send({ success: true, data: config })
  })
}
