1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-17 07:41:26 +00:00

add update all notification API

This commit is contained in:
孙永强
2024-11-27 15:06:30 +08:00
parent f4558a0f46
commit ef77d90280
3 changed files with 50 additions and 15 deletions

View File

@@ -22,7 +22,7 @@ class Notification extends React.Component {
componentDidMount() {
seafileAPI.listAllNotifications().then(res => {
let unseen_count = res.data.general_notification.unseen_count + res.data.discussion_notification.unseen_count;
let unseen_count = res.data.general.unseen_count + res.data.discussion.unseen_count;
this.setState({ unseenCount: unseen_count });
});
}
@@ -54,8 +54,8 @@ class Notification extends React.Component {
let page = 1;
let perPage = 5;
seafileAPI.listAllNotifications(page, perPage).then(res => {
let generalNoticeList = res.data.general_notification.notification_list;
let discussionNoticeList = res.data.discussion_notification.notification_list;
let generalNoticeList = res.data.general.notification_list;
let discussionNoticeList = res.data.discussion.notification_list;
this.setState({
generalNoticeList: generalNoticeList,
discussionNoticeList: discussionNoticeList
@@ -111,7 +111,7 @@ class Notification extends React.Component {
};
onMarkAllNotifications = () => {
seafileAPI.updateNotifications().then(() => {
seafileAPI.updateAllNotifications().then(() => {
this.setState({
unseenCount: 0,
});