chore: Add description in custom attributes CRUD API response (#2875)

This commit is contained in:
Muhsin Keloth
2021-08-26 01:10:45 +05:30
committed by GitHub
parent 4a23a393f7
commit 7dd42f3fd7
2 changed files with 5 additions and 2 deletions

View File

@@ -31,12 +31,13 @@ class Api::V1::Accounts::CustomAttributeDefinitionsController < Api::V1::Account
end
def fetch_custom_attribute_definition
@custom_attribute_definition = @custom_attribute_definitions.find(permitted_params[:id])
@custom_attribute_definition = Current.account.custom_attribute_definitions.find(permitted_params[:id])
end
def permitted_payload
params.require(:custom_attribute_definition).permit(
:attribute_display_name,
:attribute_description,
:attribute_display_type,
:attribute_key,
:attribute_model,
@@ -45,6 +46,6 @@ class Api::V1::Accounts::CustomAttributeDefinitionsController < Api::V1::Account
end
def permitted_params
params.permit(:id, :filter_type)
params.permit(:id, :filter_type, :attribute_model)
end
end

View File

@@ -1,5 +1,7 @@
json.id resource.id
json.attribute_display_name resource.attribute_display_name
json.attribute_display_type resource.attribute_display_type
json.attribute_description resource.attribute_description
json.attribute_key resource.attribute_key
json.attribute_model resource.attribute_model
json.default_value resource.default_value