MathiasKandelborg/TRUE-framework

View on GitHub
util/api/calls/getAllCategories.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Category } from 'cms/Category'
import { getClient } from '..'
import allCategories from '../queries/allCategories'

/**
 * @returns {Promise<Category[]>} All categories
 */
async function getAllCategories(): Promise<Category[]> {
  const data: Category[] = await getClient(false).fetch(allCategories)

  return data
}

export default getAllCategories