add tiptap
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ArticleView } from "../types";
|
||||
import type { Article } from "../types";
|
||||
import { axios } from "./BaseAPI";
|
||||
|
||||
/**
|
||||
@@ -7,7 +7,7 @@ import { axios } from "./BaseAPI";
|
||||
* @param id 文章 ID
|
||||
* @returns 文章数据
|
||||
*/
|
||||
async function view(id: string): Promise<ArticleView<any>> {
|
||||
async function view(id: string): Promise<Article> {
|
||||
return axios.get(`/article/${id}`);
|
||||
}
|
||||
|
||||
@@ -23,5 +23,5 @@ async function like(id: string): Promise<number> {
|
||||
|
||||
export default {
|
||||
view,
|
||||
like,
|
||||
like
|
||||
};
|
||||
|
||||
@@ -3,6 +3,13 @@ import type { NotifyDetail, Page, PageResult } from "../types";
|
||||
|
||||
const BASE_URI = "/notify/internal";
|
||||
|
||||
/** 查询当前用户的站内通知详情。 */
|
||||
async function internalDetail(id: string): Promise<NotifyDetail> {
|
||||
return await axios.post(`${BASE_URI}/detail`, undefined, {
|
||||
params: { id }
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询当前用户的站内通知。 */
|
||||
async function listInternal(page?: Page<NotifyDetail>, unreadOnly = false): Promise<PageResult<NotifyDetail>> {
|
||||
return await axios.post(`${BASE_URI}/internal`, page, {
|
||||
@@ -28,6 +35,7 @@ async function markAllInternalRead(): Promise<void> {
|
||||
}
|
||||
|
||||
export default {
|
||||
internalDetail,
|
||||
listInternal,
|
||||
countUnreadInternal,
|
||||
markInternalRead,
|
||||
|
||||
Reference in New Issue
Block a user