MCPcopy Create free account
hub / github.com/TheOrcDev/github-creature / getCreatureByGithubUsername

Function getCreatureByGithubUsername

server/creatures.ts:8–20  ·  view source on GitHub ↗
(githubUsername: string)

Source from the content-addressed store, hash-verified

6import { creatures, InsertCreature } from "@/db/schema";
7
8export async function getCreatureByGithubUsername(githubUsername: string) {
9 const githubUrl = `https://github.com/${githubUsername}`;
10 console.log(githubUrl);
11 try {
12 const creature = await db.query.creatures.findFirst({
13 where: (creatures, { eq }) => eq(creatures.githubProfileUrl, githubUrl),
14 });
15 return creature;
16 } catch (error) {
17 console.error(error);
18 throw new Error("Failed to get creature");
19 }
20}
21
22export async function saveCreature(creature: InsertCreature) {
23 try {

Callers 2

CreatureCardFunction · 0.90
generateMetadataFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected