Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ubongedem78 committed Apr 6, 2024
1 parent 88f8fe0 commit 2bb53ae
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ const User = sequelize.define(
user.transactionPin = await bcrypt.hash(user.transactionPin, salt);
}
},
afterCreate: async (user, options) => {
try {
const wallet = await Wallet.create({
userId: user.id,
});
console.log(`Wallet created for user with ID: ${user.id}`);
} catch (error) {
console.error("Error creating wallet:", error);
}
},
},
}
);
Expand Down

0 comments on commit 2bb53ae

Please sign in to comment.