refactor(server): trip-access primitives async at every caller

This commit is contained in:
jubnl
2026-09-23 02:46:39 +02:00
parent 8efb3c8623
commit 769b9577ec
59 changed files with 472 additions and 140 deletions
@@ -45,7 +45,7 @@ export class PluginRoutesController {
if (!pluginsEnabled()) return { route: null };
const userId = req.user?.id;
const tripId = Number(body?.tripId);
if (userId == null || !Number.isFinite(tripId) || !this.dbs.canAccessTrip(tripId, userId)) return { route: null };
if (userId == null || !Number.isFinite(tripId) || !(await this.dbs.canAccessTrip(tripId, userId))) return { route: null };
if (!PROFILE_RE.test(profileId)) return { route: null };
const waypoints = readWaypoints(body?.waypoints);
if (!waypoints) return { route: null };