ℹ Improve docs and documentation (again)
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -58,7 +58,7 @@ defmodule MobilizonWeb.API.Comments do
|
||||
@spec get_in_reply_to_comment(nil) :: nil
|
||||
defp get_in_reply_to_comment(nil), do: nil
|
||||
@spec get_in_reply_to_comment(String.t()) :: Comment.t()
|
||||
defp get_in_reply_to_comment(inReplyToCommentURL) do
|
||||
ActivityPub.fetch_object_from_url(inReplyToCommentURL)
|
||||
defp get_in_reply_to_comment(in_reply_to_comment_url) do
|
||||
ActivityPub.fetch_object_from_url(in_reply_to_comment_url)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,6 +9,9 @@ defmodule MobilizonWeb.API.Events do
|
||||
alias Mobilizon.Service.ActivityPub.Utils, as: ActivityPubUtils
|
||||
import MobilizonWeb.API.Utils
|
||||
|
||||
@doc """
|
||||
Create an event
|
||||
"""
|
||||
@spec create_event(map()) :: {:ok, Activity.t()} | any()
|
||||
def create_event(
|
||||
%{
|
||||
|
||||
@@ -9,6 +9,9 @@ defmodule MobilizonWeb.API.Groups do
|
||||
alias Mobilizon.Service.ActivityPub.Utils, as: ActivityPubUtils
|
||||
import MobilizonWeb.API.Utils
|
||||
|
||||
@doc """
|
||||
Create a group
|
||||
"""
|
||||
@spec create_group(map()) :: {:ok, Activity.t()} | any()
|
||||
def create_group(
|
||||
%{
|
||||
|
||||
@@ -4,8 +4,13 @@ defmodule MobilizonWeb.Resolvers.Address do
|
||||
"""
|
||||
require Logger
|
||||
alias Mobilizon.Addresses
|
||||
alias Mobilizon.Addresses.Address
|
||||
alias Mobilizon.Service.Geospatial
|
||||
|
||||
@doc """
|
||||
Search an address
|
||||
"""
|
||||
@spec search(map(), map(), map()) :: {:ok, list(Address.t())}
|
||||
def search(_parent, %{query: query}, %{context: %{ip: ip}}) do
|
||||
country = Geolix.lookup(ip) |> Map.get(:country, nil)
|
||||
|
||||
@@ -18,6 +23,10 @@ defmodule MobilizonWeb.Resolvers.Address do
|
||||
{:ok, addresses}
|
||||
end
|
||||
|
||||
@doc """
|
||||
Reverse geocode some coordinates
|
||||
"""
|
||||
@spec reverse_geocode(map(), map(), map()) :: {:ok, list(Address.t())}
|
||||
def reverse_geocode(_parent, %{longitude: longitude, latitude: latitude}, %{context: %{ip: ip}}) do
|
||||
country = Geolix.lookup(ip) |> Map.get(:country, nil)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user