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