Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Mar 8, 2024
1 parent 022f3e2 commit b3d7605
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/jobs/src/transactions/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,23 @@ client.defineJob({
run: async (payload, io) => {
const { transactions, teamId } = payload;

const { data: usersData } = await io.supabase.client
const { data: usersData, error: usersError } = await io.supabase.client
.from("users_on_team")
.select(
"team_id, user:users_on_team(id, full_name, avatar_url, email, locale)"
)
.eq("team_id", teamId);

if (usersError) {
await io.logger.error("Users Error", usersError);
}

await io.logger.debug("users", usersData);

const notificationPromises = usersData?.map(async ({ user, team_id }) => {
const { t } = getI18n({ locale: user.locale });
return transactions.map((transaction) => ({

return transactions?.map((transaction) => ({
name: TriggerEvents.TransactionNewInApp,
payload: {
recordId: transaction.id,
Expand Down

0 comments on commit b3d7605

Please sign in to comment.