import { ITag } from "#entities/tags"
import { apiFetch } from "../fetch"

interface IResult {
  props: { currentPage: "tags" }
  tags: ITag[]
}

export async function fetchTags() {
  const path = "/posts/tags"
  const result = await apiFetch<IResult>(path, { method: "GET" })

  return result
}
