Check userId set in sendUserNotification (#949)
This commit is contained in:
		
							parent
							
								
									889d494eaf
								
							
						
					
					
						commit
						01d779723f
					
				@ -85,6 +85,9 @@ const sendNotification = (subscription, payload) => {
 | 
			
		||||
 | 
			
		||||
async function sendUserNotification (userId, notification) {
 | 
			
		||||
  try {
 | 
			
		||||
    if (!userId) {
 | 
			
		||||
      throw new Error('user id is required')
 | 
			
		||||
    }
 | 
			
		||||
    notification.data ??= {}
 | 
			
		||||
    if (notification.item) {
 | 
			
		||||
      notification.data.url ??= await createItemUrl(notification.item)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user