Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/src/controllers/permanence.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ export const sendHourlyNotificationToUsers: AppRequestHandler = async (_req, res
return;
}

permanence_service.sendNotifications(notifications);
await permanence_service.sendNotifications(notifications);

Ok(res, { msg: 'Notifications horaires envoyées avec succès' });
};
Expand Down
4 changes: 2 additions & 2 deletions backend/src/services/permanence.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
permanence_id: permId,
});
});
} catch (error: any) {

Check warning on line 85 in backend/src/services/permanence.service.ts

View workflow job for this annotation

GitHub Actions / lint-api

Unexpected any. Specify a different type
// Gestion des erreurs de contraintes de base de données
if (
error.code === '23505' || // Contrainte unique PostgreSQL
Expand Down Expand Up @@ -441,8 +441,8 @@
export const getHourlyNotifications = async (): Promise<Notification[]> => {
const permanences = await db.query.permanenceSchema.findMany({
where: sql`
${permanenceSchema.start_at} >= date_trunc('hour', now()) + interval '1 hour'
AND ${permanenceSchema.start_at} < date_trunc('hour', now()) + interval '2 hour'
${permanenceSchema.start_at} >= now() + interval '1 hour'
AND ${permanenceSchema.start_at} < now() + interval '1 hour 5 minutes'
`,
orderBy: permanenceSchema.start_at,
});
Expand Down
Loading