add detail edit

This commit is contained in:
AceDataCloud committed 2021-08-29 01:14:54 +08:00
1 parent 83b9afcd33
commit 15631b6b6a
11 files changed
+197 -21

No files matched your search

+3 -3
View File
@@ -9,7 +9,7 @@ class ArticleService {
return await httpClient.get(`/${this.key}`);
}
async get(id: number): Promise<AxiosResponse<IArticleDetailResponse>> {
async get(id: string | string[]): Promise<AxiosResponse<IArticleDetailResponse>> {
return httpClient.get(`/${this.key}/${id}`);
}
@@ -17,11 +17,11 @@ class ArticleService {
return httpClient.post(`/${this.key}`, data);
}
async update(id: number, data: IArticle): Promise<AxiosResponse<IArticleDetailResponse>> {
async update(id: string | string[], data: IArticle): Promise<AxiosResponse<IArticleDetailResponse>> {
return httpClient.put(`/${this.key}/${id}`, data);
}
async delete(id: number): Promise<AxiosResponse<null>> {
async delete(id: string | string[]): Promise<AxiosResponse<null>> {
return httpClient.delete(`/${this.key}/${id}`);
}
}
+4
View File
@@ -1,6 +1,10 @@
export interface IArticle {
id: number;
title: string;
cover: string;
summary: string;
content: string;
updated_at: string;
}
export interface IArticleListResponse {