fix group id
This commit is contained in:
parent
ccbf824390
commit
833470cbdb
@ -13,7 +13,16 @@ export default {
|
|||||||
try {
|
try {
|
||||||
const limit = parseInt(req.query.limit) || 20;
|
const limit = parseInt(req.query.limit) || 20;
|
||||||
const offset = parseInt(req.query.offset) || 0;
|
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({
|
const result = await GroupSubscriber.findAndCountAll({
|
||||||
|
where,
|
||||||
include: [MailingGroup, Subscriber],
|
include: [MailingGroup, Subscriber],
|
||||||
limit,
|
limit,
|
||||||
offset,
|
offset,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user