2025-09-29 15:31:24 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2025-11-16 07:06:31 -05:00
|
|
|
# This controller is kept for future family-level API endpoints
|
|
|
|
|
# Location-specific endpoints have been moved to Api::V1::Families::LocationsController
|
2025-09-29 15:31:24 -04:00
|
|
|
class Api::V1::FamiliesController < ApiController
|
|
|
|
|
before_action :ensure_family_feature_enabled!
|
|
|
|
|
before_action :ensure_user_in_family!
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def ensure_user_in_family!
|
2025-10-04 16:39:47 -04:00
|
|
|
return if current_api_user.in_family?
|
|
|
|
|
|
|
|
|
|
render json: { error: 'User is not part of a family' }, status: :forbidden
|
2025-09-29 15:31:24 -04:00
|
|
|
end
|
|
|
|
|
end
|