Packages
kanta_sync_plugin
0.1.0
Kanta plugin for syncing translations on staging/dev with production
Current section
Files
Jump to
Current section
Files
lib/informations/informations.ex
defmodule Kanta.Sync.Informations do
@moduledoc false
alias Kanta.Repo
alias Kanta.Sync.Information
def update_last_fetched_at do
repo = Repo.get_repo()
case repo.get_by(Information, []) do
nil ->
changeset =
Information.changeset(%{
last_fetched_at: DateTime.utc_now()
})
repo.insert!(changeset)
information ->
information
|> Information.changeset(%{
last_fetched_at: DateTime.utc_now()
})
|> repo.update!()
end
end
end