feat: check also 400

This commit is contained in:
Nevo David 2024-08-06 16:26:39 +07:00
parent fd9a0c6d25
commit cd52032e19
3 changed files with 4 additions and 2 deletions

View File

@ -149,7 +149,7 @@ export class PostsService {
`Error posting on ${firstPost.integration?.providerIdentifier} for ${firstPost?.integration?.name}`,
`An error occurred while posting on ${
firstPost.integration?.providerIdentifier
} ${err}`,
} ${!process.env.NODE_ENV || process.env.NODE_ENV === 'development' ? err : ''}`,
true
);
}

View File

@ -14,7 +14,7 @@ export abstract class SocialAbstract {
console.log('skip');
}
}
if (request.status === 401) {
if (request.status === 401 || request.status === 400) {
throw new RefreshToken();
}

View File

@ -10,6 +10,8 @@ export class EmailService {
console.log('No Resend API Key found, skipping email sending');
return;
}
console.log('Sending email to', to);
const sends = await resend.emails.send({
from: process.env.IS_GENERAL === 'true' ? 'Nevo <nevo@postiz.com>' : 'Nevo <nevo@gitroom.com>',
to,