Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

540 B
Raw Blame
import { eq } from "drizzle-orm";
import db from "../../database";
import { userAvatarTable } from "../../database/schema";

export async function getAvatar(id: string) {
  const [avatar] = await db
    .select({
      id: userAvatarTable.id,
      mimeType: userAvatarTable.mimeType,
      size: userAvatarTable.size,
      data: userAvatarTable.data,
      updatedAt: userAvatarTable.updatedAt,
    })
    .from(userAvatarTable)
    .where(eq(userAvatarTable.id, id))
    .limit(1);

  return avatar ?? null;
}

export default getAvatar;