added Mark All As Read action to notification
parent
93f9641d8b
commit
8ac293d4b3
|
@ -42,7 +42,7 @@ const NotificationDropdown = ({ t }) => {
|
||||||
}).then(json => {
|
}).then(json => {
|
||||||
console.log(json)
|
console.log(json)
|
||||||
if (isResponseOK) {
|
if (isResponseOK) {
|
||||||
let NewnotificationList = []
|
let NewNotificationList = []
|
||||||
if (json.length > 0) {
|
if (json.length > 0) {
|
||||||
json.forEach((currentValue, index) => {
|
json.forEach((currentValue, index) => {
|
||||||
let notification = {}
|
let notification = {}
|
||||||
|
@ -52,19 +52,19 @@ const NotificationDropdown = ({ t }) => {
|
||||||
notification['message'] = json[index]['message'];
|
notification['message'] = json[index]['message'];
|
||||||
notification['created_datetime'] = moment(parseInt(json[index]['created_datetime']))
|
notification['created_datetime'] = moment(parseInt(json[index]['created_datetime']))
|
||||||
.format("YYYY-MM-DD HH:mm:ss");
|
.format("YYYY-MM-DD HH:mm:ss");
|
||||||
if (NewnotificationList.length > 3 ){
|
if (NewNotificationList.length > 3 ){
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if (notification['message'].length > 40){
|
if (notification['message'].length > 40){
|
||||||
notification['message'] = notification['message'].substring(0,30) + "...";
|
notification['message'] = notification['message'].substring(0,30) + "...";
|
||||||
}
|
}
|
||||||
if (notification["status"] === "new"){
|
if (notification["status"] === "new"){
|
||||||
NewnotificationList.push(notification);
|
NewNotificationList.push(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
setRawNewNotificationschild(NewnotificationList);
|
setRawNewNotificationschild(NewNotificationList);
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
@ -126,7 +126,7 @@ const NotificationDropdown = ({ t }) => {
|
||||||
}).then(json => {
|
}).then(json => {
|
||||||
console.log(json)
|
console.log(json)
|
||||||
if (isResponseOK) {
|
if (isResponseOK) {
|
||||||
let NewnotificationList = []
|
let NewNotificationList = []
|
||||||
if (json.length > 0) {
|
if (json.length > 0) {
|
||||||
json.forEach((currentValue, index) => {
|
json.forEach((currentValue, index) => {
|
||||||
let notification = {}
|
let notification = {}
|
||||||
|
@ -136,19 +136,19 @@ const NotificationDropdown = ({ t }) => {
|
||||||
notification['message'] = json[index]['message'];
|
notification['message'] = json[index]['message'];
|
||||||
notification['created_datetime'] = moment(parseInt(json[index]['created_datetime']))
|
notification['created_datetime'] = moment(parseInt(json[index]['created_datetime']))
|
||||||
.format("YYYY-MM-DD HH:mm:ss");
|
.format("YYYY-MM-DD HH:mm:ss");
|
||||||
if (NewnotificationList.length > 3 ){
|
if (NewNotificationList.length > 3 ){
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if (notification['message'].length > 40){
|
if (notification['message'].length > 40){
|
||||||
notification['message'] = notification['message'].substring(0,30) + "...";
|
notification['message'] = notification['message'].substring(0,30) + "...";
|
||||||
}
|
}
|
||||||
if (notification["status"] === "new"){
|
if (notification["status"] === "new"){
|
||||||
NewnotificationList.push(notification);
|
NewNotificationList.push(notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
setRawNewNotificationschild(NewnotificationList);
|
setRawNewNotificationschild(NewNotificationList);
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|
Loading…
Reference in New Issue