Add backend to remove pictures

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-11-20 16:35:48 +01:00
parent 03e4916ebf
commit 1cd680526a
3 changed files with 144 additions and 74 deletions

View File

@@ -35,7 +35,7 @@ defmodule Mobilizon.GraphQL.Schema.PictureType do
object :picture_queries do
@desc "Get a picture"
field :picture, :picture do
arg(:id, non_null(:string), description: "The picture ID")
arg(:id, non_null(:id), description: "The picture ID")
resolve(&Picture.picture/3)
end
end
@@ -48,5 +48,13 @@ defmodule Mobilizon.GraphQL.Schema.PictureType do
arg(:file, non_null(:upload), description: "The picture file")
resolve(&Picture.upload_picture/3)
end
@desc """
Remove a picture
"""
field :remove_picture, :deleted_object do
arg(:id, non_null(:id), description: "The picture's ID")
resolve(&Picture.remove_picture/3)
end
end
end