Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F74191645
backup_controller.ex
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
951 B
Referenced Files
None
Subscribers
None
backup_controller.ex
View Options
# Pleroma: A lightweight social networking server
# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma.Web.PleromaAPI.BackupController
do
use
Pleroma.Web
,
:controller
alias
Pleroma.User.Backup
alias
Pleroma.Web.Plugs.OAuthScopesPlug
action_fallback
(
Pleroma.Web.MastodonAPI.FallbackController
)
plug
(
OAuthScopesPlug
,
%{
scopes
:
[
"read:accounts"
]}
when
action
in
[
:index
,
:create
])
plug
(
Pleroma.Web.ApiSpec.CastAndValidate
)
defdelegate
open_api_operation
(
action
),
to
:
Pleroma.Web.ApiSpec.PleromaBackupOperation
def
index
(%{
assigns
:
%{
user
:
user
}}
=
conn
,
_params
)
do
backups
=
Backup
.
list
(
user
)
render
(
conn
,
"index.json"
,
backups
:
backups
)
end
def
create
(%{
assigns
:
%{
user
:
user
}}
=
conn
,
_params
)
do
with
{
:ok
,
_
}
<-
Backup
.
create
(
user
)
do
backups
=
Backup
.
list
(
user
)
render
(
conn
,
"index.json"
,
backups
:
backups
)
end
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Sat, Apr 25, 6:13 AM (1 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1309826
Default Alt Text
backup_controller.ex (951 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment