mirror of
https://github.com/aelve/guide.git
synced 2024-12-26 06:11:33 +03:00
22 lines
408 B
TypeScript
22 lines
408 B
TypeScript
|
import axios from "axios";
|
||
|
|
||
|
class CategoryService {
|
||
|
async getCategoryList(): Promise<ICategory[]> {
|
||
|
const { data } = await axios.get("api/categories", {})
|
||
|
return data
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export interface ICategory {
|
||
|
created: string
|
||
|
group: string
|
||
|
status: string
|
||
|
title: string
|
||
|
uid: string
|
||
|
}
|
||
|
|
||
|
const categoryServiceInstance = new CategoryService()
|
||
|
|
||
|
|
||
|
export { categoryServiceInstance as CategoryService }
|