1
1
mirror of https://github.com/aelve/guide.git synced 2024-12-26 22:34:42 +03:00
guide/front/client/service/Category.ts
2018-09-16 16:32:35 +03:00

29 lines
543 B
TypeScript

import axios from "axios";
class CategoryService {
async getCategoryList(): Promise<ICategory[]> {
const { data } = await axios.get("api/categories", {})
return data
}
}
export enum CategoryStatus {
finished = 'CategoryFinished',
inProgress = 'CategoryWIP',
toBeWritten = 'CategoryStub'
}
export interface ICategory {
created: string
group: string
status: CategoryStatus
title: string
uid: string
}
const categoryServiceInstance = new CategoryService()
export { categoryServiceInstance as CategoryService }