+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.Bookmark do
use Ecto.Schema
|> preload([b, a], activity: a)
end
+ def get(user_id, activity_id) do
+ Bookmark
+ |> where(user_id: ^user_id)
+ |> where(activity_id: ^activity_id)
+ |> Repo.one()
+ end
+
@spec destroy(FlakeId.t(), FlakeId.t()) :: {:ok, Bookmark.t()} | {:error, Changeset.t()}
def destroy(user_id, activity_id) do
from(b in Bookmark,