add detail edit
This commit is contained in:
1 parent
83b9afcd33
commit
15631b6b6a
11 files changed
+197
-21
No files matched your search
@@ -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}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
export interface IArticle {
|
||||
id: number;
|
||||
title: string;
|
||||
cover: string;
|
||||
summary: string;
|
||||
content: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface IArticleListResponse {
|
||||
|
||||
Reference in new issue
Block a user