2019-05-28 06:14:26 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
|
|
|
module Helpers
|
|
|
|
module UsersHelpers
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
extend Grape::API::Helpers
|
|
|
|
|
|
|
|
params :optional_params_ee do
|
|
|
|
end
|
|
|
|
|
|
|
|
params :optional_index_params_ee do
|
|
|
|
end
|
2020-07-09 20:09:13 -04:00
|
|
|
|
|
|
|
def model_error_messages(model)
|
|
|
|
super.tap do |error_messages|
|
|
|
|
# Remapping errors from nested associations.
|
|
|
|
error_messages[:bio] = error_messages.delete(:"user_detail.bio") if error_messages.has_key?(:"user_detail.bio")
|
|
|
|
end
|
|
|
|
end
|
2019-05-28 06:14:26 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2019-09-13 09:26:31 -04:00
|
|
|
|
2021-05-11 17:10:21 -04:00
|
|
|
API::Helpers::UsersHelpers.prepend_mod_with('API::Helpers::UsersHelpers')
|