u
This commit is contained in:
1 parent
9eb5639d84
commit
e9ad523fcf
19 files changed
+782
-167
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import type { AddPostParams, Post, PostEditorForm, QueryPostParams, UpdatePostParams } from '@/types/post/editor'
|
||||
|
||||
import type { DashboardData } from '@/types/post'
|
||||
import type { AddPostParams, DeletePostParams, Post, PostEditorForm, QueryPostParams, UpdatePostParams, UpdatePostStatusParams } from '@/types/post/editor'
|
||||
import { httpGet, httpPostJson } from '@/request/utils'
|
||||
|
||||
export function addPostApi(params: AddPostParams) {
|
||||
@@ -10,6 +10,22 @@ export function updatePostApi(params: UpdatePostParams) {
|
||||
return httpPostJson<PostEditorForm>('/post/update', params)
|
||||
}
|
||||
|
||||
export function updatePostStatusApi(params: UpdatePostStatusParams) {
|
||||
return httpPostJson<PostEditorForm>('/post/update/status', params)
|
||||
}
|
||||
|
||||
export function queryPostApi(params: QueryPostParams) {
|
||||
return httpPostJson<BasePageResult<Post>>('/post/query', params)
|
||||
}
|
||||
|
||||
export function getPostApi(id: number) {
|
||||
return httpGet<PostEditorForm>(`/post/${id}`)
|
||||
}
|
||||
|
||||
export function deletePostApi(params: DeletePostParams) {
|
||||
return httpPostJson<void>('/post/delete', params)
|
||||
}
|
||||
|
||||
export function getDashboardDataApi() {
|
||||
return httpGet<DashboardData>(`/post/dashboard`)
|
||||
}
|
||||
Reference in new issue
Block a user