Ensure uniform code formatting across components by aligning with the established code style. Adjust imports, indentation, and spacing to enhance readability and maintainability.
15 lines
366 B
TypeScript
15 lines
366 B
TypeScript
import api from "@/lib/api";
|
|
import type { Category } from "@/types/content";
|
|
|
|
export const CategoryService = {
|
|
async getAll(): Promise<Category[]> {
|
|
const { data } = await api.get<Category[]>("/categories");
|
|
return data;
|
|
},
|
|
|
|
async getOne(id: string): Promise<Category> {
|
|
const { data } = await api.get<Category>(`/categories/${id}`);
|
|
return data;
|
|
},
|
|
};
|