import IShortcode from "@/interfaces/IShortcode"; import request from "./request"; export default async function getShortcode(code: string): Promise { const res = await request(`/shortcodes/${code}`, { method: "GET", requiresAuth: false, }); if (res.status === "Error" || !res.data) throw new Error("Shortcode doesn't exist."); return res.data; }