Update Book and Publisher transformers to sync the relationship for DBIServer.
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user