public function update(Domain $domain, ClientSurvey $id, StoreClientSurveyAPI $request, ClientSurveyService $client_survey_service): JsonResource 	{ 		$client = $request->user()->user;  		if ($client_survey_service->canEditSurvey($id, $client)) { 			abort(403, (string) __('client-surveys.you-cannot-edit-this-survey')); 		}  		$survey = $client_survey_service->updateClientSurvey($id, $request, $client);  		$client_survey_service->handleExtraAndDemographicQuestions($request, $survey);  		$survey->generateApplicants($request->emails, $request->offline_applicants_count, $request->email_languages);  		$client_survey_service->handleQuestionScrambling($survey);  		$client_survey_service->handleLocationsAndDepartmentDeletion($request, $survey); 		$client_survey_service->handleLocationsAndDepartmentCreation($request, $survey); 		$client_survey_service->handleLocationsAndDepartmentUpdate($request, $survey);  		if (!$survey->draft) { 			$client_survey_service->changeSurveyToPending($survey); 		}  		// Schedule webhooks | Won't schedule if testing 		$client_survey_notification_service = new ClientSurveyNotificationService; 		$client_survey_notification_service->handleWebhooks($id);  		$id->load([ 			'locations', 			'departments', 			'extraQuestions', 			'demographicQuestions', 			'applicants' => function ($query) { 				$query->fillingOnlineSurvey()->mailable(); 			}, 		]);  		return new ClientSurveyResourceSingle($id); 	}