mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 08:17:32 -05:00 
			
		
		
		
	Fixes for Email histoyr
This commit is contained in:
		
							parent
							
								
									0694378bb5
								
							
						
					
					
						commit
						fb3c0120ec
					
				@ -31,11 +31,11 @@ class EmailHistoryController extends BaseController
 | 
				
			|||||||
                 ->where('category_id', SystemLog::CATEGORY_MAIL)
 | 
					                 ->where('category_id', SystemLog::CATEGORY_MAIL)
 | 
				
			||||||
                 ->orderBy('id', 'DESC')
 | 
					                 ->orderBy('id', 'DESC')
 | 
				
			||||||
                 ->cursor()
 | 
					                 ->cursor()
 | 
				
			||||||
                 ->map(function ($system_log) {
 | 
					                ->filter(function ($system_log) {
 | 
				
			||||||
                     if(($system_log->log['history'] && $system_log->log['history']['events'] && count($system_log->log['history']['events']) >=1) ?? false) {
 | 
					                    return ($system_log->log['history'] && isset($system_log->log['history']['events']) && count($system_log->log['history']['events']) >=1) !== false;
 | 
				
			||||||
 | 
					                })->map(function  ($system_log) {
 | 
				
			||||||
                    return $system_log->log['history'];
 | 
					                    return $system_log->log['history'];
 | 
				
			||||||
                     }
 | 
					                })->values()->all();
 | 
				
			||||||
                 });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return response()->json($data, 200);
 | 
					        return response()->json($data, 200);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -51,16 +51,17 @@ class EmailHistoryController extends BaseController
 | 
				
			|||||||
        /** @var \App\Models\User $user */
 | 
					        /** @var \App\Models\User $user */
 | 
				
			||||||
        $user = auth()->user();
 | 
					        $user = auth()->user();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $data = SystemLog::where('company_id', $user->company()->id)
 | 
					        $data = SystemLog::where('company_id', $user->company()->id)
 | 
				
			||||||
        ->where('category_id', SystemLog::CATEGORY_MAIL)
 | 
					        ->where('category_id', SystemLog::CATEGORY_MAIL)
 | 
				
			||||||
        ->whereJsonContains('log->history->entity_id', $this->encodePrimaryKey($request->entity_id))
 | 
					        ->whereJsonContains('log->history->entity_id', $this->encodePrimaryKey($request->entity_id))
 | 
				
			||||||
        ->orderBy('id', 'DESC')
 | 
					        ->orderBy('id', 'DESC')
 | 
				
			||||||
        ->cursor()
 | 
					        ->cursor()
 | 
				
			||||||
                ->map(function ($system_log) {
 | 
					        ->filter(function ($system_log) {
 | 
				
			||||||
                    if(($system_log->log['history'] && $system_log->log['history']['events'] && count($system_log->log['history']['events']) >=1) ?? false) {
 | 
					            return ($system_log->log['history'] && isset($system_log->log['history']['events']) && count($system_log->log['history']['events']) >=1) !== false;
 | 
				
			||||||
 | 
					        })->map(function  ($system_log) {
 | 
				
			||||||
            return $system_log->log['history'];
 | 
					            return $system_log->log['history'];
 | 
				
			||||||
                    }
 | 
					        })->values()->all();
 | 
				
			||||||
                });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return response()->json($data, 200);
 | 
					        return response()->json($data, 200);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user