fix group id

This commit is contained in:
romantarkin 2025-08-18 11:14:42 +05:00
parent ccbf824390
commit 833470cbdb

View File

@ -13,7 +13,16 @@ export default {
try {
const limit = parseInt(req.query.limit) || 20;
const offset = parseInt(req.query.offset) || 0;
const { group_id } = req.query;
// Создаем условия для фильтрации
const where = {};
if (group_id) {
where.group_id = group_id;
}
const result = await GroupSubscriber.findAndCountAll({
where,
include: [MailingGroup, Subscriber],
limit,
offset,