Ich versuche, eine Benachrichtigung für Benutzer zu erstellen.get ID 'ID' vor dem Erstellen/Speichern | Sails Js
mit Benachrichtigung URL in Beschreibung wie diese http://localhost:1337/invited/accept?referrer=msgIcon&id=this-notification-id
die URL hat ID dieser neu erstellten Benachrichtigung.
AppUserNotification.create({
projectId: projectId,
appuser: appusers.id,
notificationTitle: 'You are invited in project',
isRead: 0,
description: 'You are invited in project collaboration, '
+ 'please accept invitation by following the link.\nHave a good day !\n'
+ 'Accept Invitation http://localhost:1337/invited/accept?referrer=msgIcon&id=this-notification-id',
}).exec(function (err, appuserNotifications) {
apiStatus = 1; // heading toward success
if (err){
return false;
}else if(appuserNotifications){
return true;
}
});//</after AppUserNotification.create()>
Ich möchte einen Link in der Beschreibung mit dieser neu erstellten Benachrichtigung speichern. aber es gelang mir nicht. bitte hilf mir.
Sie kann das tun. Die ID stammt aus der Datenbank, daher ist sie nur im Rückruf verfügbar. Sie können es direkt nach der Erstellung aktualisieren. '' 'appuserNotifications.description = 'Ihr Name mit ID'; appuserNotifications.save() '' ' – Bonanza