Update the sync for Author and Publisher to verify synced data.

This commit is contained in:
2025-04-02 12:52:30 +03:00
parent 133d788584
commit fb90783c35
6 changed files with 21 additions and 8 deletions
@@ -9,6 +9,7 @@ defmodule DecentralisedBookIndex.Sync.AuthorSync do
attrs
|> Map.delete(:id)
|> Map.delete(:author_alias_registry_id)
|> Map.put(:dbi_server_id, server_id)
author
|> Ash.Changeset.for_update(:sync, attrs)
@@ -8,6 +8,7 @@ defmodule DecentralisedBookIndex.Sync.PublisherSync do
attrs =
attrs
|> Map.delete(:id)
|> Map.put(:dbi_server_id, server_id)
publisher
|> Ash.Changeset.for_update(:sync, attrs)
@@ -5,6 +5,8 @@ defmodule DecentralisedBookIndex.SyncTasks.SyncAuthorsTask do
alias DecentralisedBookIndex.Metadata.DBIServer
require Logger
def sync(%DBIServer{} = server) do
url = "#{server.url}/api/v1/json/authors"
FetchJsons.get(url, sync_author_closure(server))
@@ -5,6 +5,8 @@ defmodule DecentralisedBookIndex.SyncTasks.SyncPublishersTask do
alias DecentralisedBookIndex.Metadata.DBIServer
require Logger
def sync(%DBIServer{} = server) do
url = "#{server.url}/api/v1/json/publishers"
FetchJsons.get(url, sync_closure(server))