projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MastoAPI: Return id as string instead of integer.
[akkoma]
/
lib
/
pleroma
/
object.ex
diff --git
a/lib/pleroma/object.ex
b/lib/pleroma/object.ex
index 5b51d6be340170e649c55b7e8c8d06083c9464a2..a5a1d6a763a94302bb163fdf90de0b2802387fcb 100644
(file)
--- a/
lib/pleroma/object.ex
+++ b/
lib/pleroma/object.ex
@@
-21,9
+21,10
@@
defmodule Pleroma.Object do
|> unique_constraint(:ap_id, name: :objects_unique_apid_index)
end
|> unique_constraint(:ap_id, name: :objects_unique_apid_index)
end
+ def get_by_ap_id(nil), do: nil
def get_by_ap_id(ap_id) do
Repo.one(from object in Object,
def get_by_ap_id(ap_id) do
Repo.one(from object in Object,
- where: fragment("
? @> ?", object.data, ^%{id: ap_id}
))
+ where: fragment("
(?)->>'id' = ?", object.data, ^ap_id
))
end
def get_cached_by_ap_id(ap_id) do
end
def get_cached_by_ap_id(ap_id) do