import { Response } from 'express';
import { authorService } from '../../../services/authorService';
import { AuthRequest } from "../../../middleware/auth";


// Изменить количество лайков
export async function updateLikes(req: AuthRequest, res: Response): Promise<void> {
  try {
    const { role, page } = req.query;
    const authors = await authorService.getAuthors(Number(page), role as string);
    res.json(authors);
  } catch {
    res.status(500).json({ error: 'Серверная ошибка' });
  }
}
