// @ts-nocheck — route controller converted to .cts; handler req/res typed, full type-check deferred (thin glue over typed services).
import type { Req, Res, Next } from '../types/http';
('use strict');

const express = require('express');
const router = express.Router();
const { getUserSettings, setUserSettings } = require('../services/userSettings.cts');

// GET /api/settings — returns only user-facing app preferences
router.get('/', (req: Req, res: Res) => {
  res.json(getUserSettings(req.user.id));
});

// PUT /api/settings — updates only allowed user-facing keys for this user
router.put('/', (req: Req, res: Res) => {
  res.json(setUserSettings(req.user.id, req.body));
});

module.exports = router;
