File size: 334 Bytes
57a889c
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
import { canAccessTrip } from '../db/database';

/**
 * Returns the trip row if the user is the owner or a member, otherwise undefined.
 * Shared by the domain services so each one exposes the same access check.
 */
export function verifyTripAccess(tripId: string | number, userId: number) {
  return canAccessTrip(tripId, userId);
}