0.12.15 : add activity as a service
Some checks failed
Build release Docker image / Build Docker Images (push) Failing after 8s
Some checks failed
Build release Docker image / Build Docker Images (push) Failing after 8s
This commit is contained in:
@@ -531,24 +531,16 @@ module.exports = (plugin) => {
|
||||
async afterCreate(event) {
|
||||
const { result } = event;
|
||||
|
||||
const newActivity = {
|
||||
activityMessage: `Bienvenue ${result.username}, Ton compte est maintenant activé.`,
|
||||
activityUser: result.username,
|
||||
activityDate: new Date(),
|
||||
activityType: "user" as const,
|
||||
};
|
||||
|
||||
await sendConfirmationEmail(result);
|
||||
|
||||
await strapi.entityService.update(
|
||||
"plugin::users-permissions.user",
|
||||
result.id,
|
||||
{
|
||||
data: {
|
||||
activities: [newActivity],
|
||||
},
|
||||
}
|
||||
);
|
||||
await strapi
|
||||
.service("api::notification.notification")
|
||||
?.addActivity({
|
||||
userId: result.id,
|
||||
activityMessage: `Bienvenue ${result.username}, Ton compte est maintenant activé.`,
|
||||
activityUser: result.username,
|
||||
activityType: "user",
|
||||
});
|
||||
|
||||
// Appel du service de notification
|
||||
await strapi
|
||||
|
||||
Reference in New Issue
Block a user