fix: Missing user scope in collection mailer
This commit is contained in:
@@ -249,7 +249,9 @@ export class Mailer {
|
||||
collectionId: string;
|
||||
unsubscribeUrl: string;
|
||||
}) => {
|
||||
const collection = await Collection.findByPk(opts.collectionId);
|
||||
const collection = await Collection.scope("withUser").findByPk(
|
||||
opts.collectionId
|
||||
);
|
||||
invariant(collection, "Collection not found");
|
||||
|
||||
this.sendMail({
|
||||
|
||||
@@ -73,6 +73,15 @@ type Sort = CollectionSort;
|
||||
},
|
||||
],
|
||||
},
|
||||
withUser: () => ({
|
||||
include: [
|
||||
{
|
||||
model: User,
|
||||
required: true,
|
||||
as: "user",
|
||||
},
|
||||
],
|
||||
}),
|
||||
withMembership: (userId: string) => ({
|
||||
include: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user