Skip to content

Commit

Permalink
[MS-759] feat: Add permission. Fix sqs batching response (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrgrundas committed Nov 6, 2024
1 parent 22923d9 commit afda762
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ SQS_QUEUE_URL=http://host.docker.internal:4566/000000000000/nimara-mailer-queue

# Secret manager secret
SECRET_MANAGER_APP_CONFIG_PATH=nimara-mailer
AWS_ACCESS_KEY_ID=
AWS_REGION=ap-southeast-1

# AWS credentials - not needed for localstack
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

# One of: NODE_MAILER, AWS_SES
Expand Down
1 change: 1 addition & 0 deletions src/api/rest/saleor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const saleorRoutes: FastifyPluginAsync = async (
"MANAGE_ORDERS",
"MANAGE_PRODUCTS",
"MANAGE_SHIPPING",
"MANAGE_USERS",
],
tokenTargetUrl: request.urlFor("saleor:register"),
version: CONFIG.VERSION,
Expand Down
6 changes: 3 additions & 3 deletions src/emails-sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const handler = Sentry.wrapHandler(
event: SQSEvent,
context: Context,
callback: Callback
): Promise<SQSBatchResponse> => {
): Promise<SQSBatchResponse | void> => {
const batchItemFailures: SQSBatchItemFailure[] = [];

logger.info(`Received event with ${event.Records.length} records.`);
Expand Down Expand Up @@ -107,8 +107,8 @@ export const handler = Sentry.wrapHandler(
({ itemIdentifier }) => itemIdentifier
);
logger.error(`Failed messages: ${failedMessagesId.join(", ")}.`);
}

return { batchItemFailures };
return { batchItemFailures };
}
}
);

0 comments on commit afda762

Please sign in to comment.