Lint
This commit is contained in:
parent
a1b95922c5
commit
070fbb89e1
|
@ -65,7 +65,11 @@ defp backup do
|
||||||
file_name: %Schema{type: :string},
|
file_name: %Schema{type: :string},
|
||||||
file_size: %Schema{type: :integer},
|
file_size: %Schema{type: :integer},
|
||||||
processed: %Schema{type: :boolean, description: "whether this backup has succeeded"},
|
processed: %Schema{type: :boolean, description: "whether this backup has succeeded"},
|
||||||
state: %Schema{type: :string, description: "the state of the backup", enum: ["pending", "running", "complete", "failed"]},
|
state: %Schema{
|
||||||
|
type: :string,
|
||||||
|
description: "the state of the backup",
|
||||||
|
enum: ["pending", "running", "complete", "failed"]
|
||||||
|
},
|
||||||
processed_number: %Schema{type: :integer, description: "the number of records processed"}
|
processed_number: %Schema{type: :integer, description: "the number of records processed"}
|
||||||
},
|
},
|
||||||
example: %{
|
example: %{
|
||||||
|
|
|
@ -11,11 +11,11 @@ defmodule Pleroma.Web.PleromaAPI.BackupView do
|
||||||
def render("show.json", %{backup: %Backup{} = backup}) do
|
def render("show.json", %{backup: %Backup{} = backup}) do
|
||||||
# To deal with records before the migration
|
# To deal with records before the migration
|
||||||
state =
|
state =
|
||||||
if backup.state == :invalid do
|
if backup.state == :invalid do
|
||||||
if backup.processed, do: :complete, else: :failed
|
if backup.processed, do: :complete, else: :failed
|
||||||
else
|
else
|
||||||
backup.state
|
backup.state
|
||||||
end
|
end
|
||||||
|
|
||||||
%{
|
%{
|
||||||
id: backup.id,
|
id: backup.id,
|
||||||
|
|
Loading…
Reference in New Issue