From 3f6ffb24354110ec74efcad2fbeb288c5328a754 Mon Sep 17 00:00:00 2001 From: Kyle Boe Date: Fri, 7 Jun 2024 15:57:43 -0700 Subject: [PATCH] don't merge when we don't need to --- lib/jsonapi/serializer.ex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/jsonapi/serializer.ex b/lib/jsonapi/serializer.ex index 82eaa0db..c0391015 100644 --- a/lib/jsonapi/serializer.ex +++ b/lib/jsonapi/serializer.ex @@ -66,13 +66,12 @@ defmodule JSONAPI.Serializer do relationships: %{} } - doc = custom_merge_links(encoded_data, view.links(data, conn)) # doc = merge_links(encoded_data, data, view, conn, nil, remove_links?(), options) doc = case view.meta(data, conn) do - nil -> doc - meta -> Map.put(doc, :meta, meta) + nil -> encoded_data + meta -> Map.put(encoded_data, :meta, meta) end encode_relationships(conn, doc, {view, data, query_includes, valid_includes}, options)