You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: extra_fields.rb
    path of file: ./repos/openfoodnetwork/app/controllers/concerns
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# To be included in api controllers for handeling query params
module ExtraFields
  extend ActiveSupport::Concern

  def invalid_query_param(name, status, msg)
    render st
    
  def extra_fields(type, available_fields)
    fields = params.dig(:extra_fields, type)&.split(',')&.compact&.map(&:to_sym)
    return [] if fields.blank?

    unknown_fields = fields - available_fields

    if unknown_fields.present?
      invalid_query_param(
        "extra_fields[#{type}]", :unprocessable_entity,
        I18n.t("api.query_param.error.extra_fields", fields: unknown_fields.join(', '))
      )
    end