Skip to content

Instantly share code, notes, and snippets.

View spejman's full-sized avatar

Sergio Espeja spejman

View GitHub Profile
defmodule BFFWeb.V2.UnreadNotificationsController do
use BFFWeb, :controller
def index(conn, params) do
{conversations_count, offers_pending_count, jobs_pending_count} =
async with {:ok, candidate_id} <- Candidates.get_current_candidate_id(conn.assigns.auth_token),
{:ok, conversations_count} <- Conversations.count_unread_conversations(candidate_id),
{:ok, offers_pending_count} <- Transactions.count_offers_pending(candidate_id),
{:ok, jobs_pending_count} <- Transactions.count_jobs_pending(candidate_id) do
{conversations_count, offers_pending_count, jobs_pending_count}

Keybase proof

I hereby claim:

  • I am spejman on github.
  • I am spejman (https://keybase.io/spejman) on keybase.
  • I have a public key ASD09yvRJ-kME0tiJEQ9zTkaJ2Jz1jpAh3UCbAz5fAuFygo

To claim this, I am signing this object: