0
我想爲用戶創建一個通知。在創建/保存|之前獲得記錄`id`風帆Js
與此類描述中的通知網址http://localhost:1337/invited/accept?referrer=msgIcon&id=this-notification-id
此網址具有此新創建通知的ID。
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()>
我想要做的就是用這個新創建的通知保存描述中的鏈接。但無法做到這一點。 請幫助我。
你不能做到這一點。 Id來自數據庫,因此它只能在回調中訪問。您可以在創建後立即更新它。 '''appuserNotifications.description ='你的帶ID的desc'; appuserNotifications.save()''' – Bonanza