Update Book and Publisher transformers to sync the relationship for DBIServer.

This commit is contained in:
2025-05-06 15:16:06 +03:00
parent d57fa73825
commit 5d8e70d79d
4 changed files with 24 additions and 8 deletions
@@ -21,7 +21,9 @@ defmodule DecentralisedBookIndex.Sync.DataTransformers.BookTransformer do
inserted_at: get_in(json_body, ["attributes", "inserted_at"]),
updated_at: get_in(json_body, ["attributes", "updated_at"]),
# relationship
publisher_id: get_in(json_body, ["attributes", "publisher_id"])
publisher_id: get_in(json_body, ["attributes", "publisher_id"]),
# relationship
dbi_server_id: get_in(json_body, ["attributes", "dbi_server_id"])
}
{:ok, attrs}
@@ -12,7 +12,9 @@ defmodule DecentralisedBookIndex.Sync.DataTransformers.PublisherTransformer do
id: get_in(json_body, ["id"]),
name: get_in(json_body, ["attributes", "name"]),
inserted_at: get_in(json_body, ["attributes", "inserted_at"]),
updated_at: get_in(json_body, ["attributes", "updated_at"])
updated_at: get_in(json_body, ["attributes", "updated_at"]),
# relationship
dbi_server_id: get_in(json_body, ["attributes", "dbi_server_id"])
}
{:ok, attrs}