YZ
const unread = await SubscriberNotification.findAll({
include: [
{
model: Notification,
as: 'notification',
required: true,
where: {
status: Notification.NOTIFICATION_STATUS_SENDED,
},
},
{
model: SubscriberNotificationRead,
as: 'read',
required: true,
},
],
where: {
userName: sub,
},
});
Запутался немного, как мне заинклудить чтобы получить записи которых НЕТ в SubscriberNotificationReadТо есть получаю пользователя (SubscriberNotification) в него загружаю все уведомления (Notification) которые отправлены (NOTIFICATION_STATUS_SENDED), НО которые еще не прочитаны (нет в SubscriberNotificationRead)
