|  | @@ -41,7 +41,7 @@ class HealthyPassPortController extends Controller
 | 
	
		
			
			| 41 | 41 |       */
 | 
	
		
			
			| 42 | 42 |      public function post(Request $request){
 | 
	
		
			
			| 43 | 43 |          $lineUserId = $request->lineUserId; //line UID
 | 
	
		
			
			| 44 |  | -        $headSticker = $request->headSticker; //頭貼
 | 
	
		
			
			|  | 44 | +        $headSticker = $request->headSticker ?? ""; //頭貼
 | 
	
		
			
			| 45 | 45 |          $healthAction = $request->healthAction; //平常你有什麼健康行動(複選)
 | 
	
		
			
			| 46 | 46 |          $healthTopic = $request->healthTopic; //你對什麼健康話題有興趣(複選)
 | 
	
		
			
			| 47 | 47 |          $healthStatus = $request->healthStatus; //你覺得自己的身體狀況如何
 | 
	
	
		
			
			|  | @@ -81,7 +81,10 @@ class HealthyPassPortController extends Controller
 | 
	
		
			
			| 81 | 81 |              $this->botActionsSend($lineUserId,$buildActions);
 | 
	
		
			
			| 82 | 82 |  
 | 
	
		
			
			| 83 | 83 |              //儲存填寫資料
 | 
	
		
			
			| 84 |  | -            $survey_data = new Survey();
 | 
	
		
			
			|  | 84 | +            $survey_data = Survey::where('line_user_id',$lineUserId)->first();
 | 
	
		
			
			|  | 85 | +            if(empty($survey_data->id)){
 | 
	
		
			
			|  | 86 | +                $survey_data = new Survey();
 | 
	
		
			
			|  | 87 | +            }
 | 
	
		
			
			| 85 | 88 |              $survey_data->line_user_id = $lineUserId;
 | 
	
		
			
			| 86 | 89 |              $survey_data->head_sticker = $headSticker;
 | 
	
		
			
			| 87 | 90 |              $survey_data->nickname = $healthNickname;
 |