fix
This commit is contained in:
@@ -60,17 +60,12 @@ function send(app: PublicAPIApp) {
|
||||
const team = c.var.team;
|
||||
const emailId = c.req.param("emailId");
|
||||
|
||||
const whereClause: { id: string; teamId: number; domainId?: number } = {
|
||||
id: emailId,
|
||||
teamId: team.id,
|
||||
};
|
||||
|
||||
if (team.apiKey.domainId !== null) {
|
||||
whereClause.domainId = team.apiKey.domainId;
|
||||
}
|
||||
|
||||
const email = await db.email.findUnique({
|
||||
where: whereClause,
|
||||
where: {
|
||||
id: emailId,
|
||||
teamId: team.id,
|
||||
domainId: team.apiKey.domainId ?? undefined,
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
teamId: true,
|
||||
|
||||
@@ -48,7 +48,11 @@ function updateEmailScheduledAt(app: PublicAPIApp) {
|
||||
const team = c.var.team;
|
||||
const emailId = c.req.param("emailId");
|
||||
|
||||
await checkIsValidEmailIdWithDomainRestriction(emailId, team.id, team.apiKey.domainId);
|
||||
await checkIsValidEmailIdWithDomainRestriction(
|
||||
emailId,
|
||||
team.id,
|
||||
team.apiKey.domainId ?? undefined
|
||||
);
|
||||
|
||||
await updateEmail(emailId, {
|
||||
scheduledAt: c.req.valid("json").scheduledAt,
|
||||
|
||||
Reference in New Issue
Block a user