mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-05-05 08:03:08 +00:00
11 lines
313 B
TypeScript
11 lines
313 B
TypeScript
import { Category } from "./types";
|
|
|
|
export const fetchCategories = async () => {
|
|
const response = await fetch("api/categories");
|
|
if (!response.ok) {
|
|
throw new Error(`Failed to fetch categories: ${response.statusText}`);
|
|
}
|
|
const categories: Category[] = await response.json();
|
|
return categories;
|
|
};
|