diff --git a/src/Http/Controllers/CampaignController.php b/src/Http/Controllers/CampaignController.php index 26de1b0..88462be 100644 --- a/src/Http/Controllers/CampaignController.php +++ b/src/Http/Controllers/CampaignController.php @@ -85,6 +85,7 @@ public function show(Campaign $campaign) 'leads' => [ 'syncTags' => route('teamtnt.sales-management.leads.sync-tags', ':leadId'), 'leadData' => route('teamtnt.sales-management.lead.data', [$campaign, ':leadId']), + 'leadStageChange' => route('teamtnt.sales-management.lead.stage.change', [$campaign, ':leadId']), ], 'messages' => [ 'send' => route('teamtnt.sales-management.send.message', [$campaign, ':leadId']), diff --git a/src/Http/Controllers/LeadsController.php b/src/Http/Controllers/LeadsController.php index e879ca7..e2de8b0 100644 --- a/src/Http/Controllers/LeadsController.php +++ b/src/Http/Controllers/LeadsController.php @@ -60,4 +60,16 @@ public function getLeadData(Campaign $campaign, Lead $lead) ]); } + public function leadStageChange(Campaign $campaign, Lead $lead, Request $request) + { + if (!$lead) { + return response()->json(404); + } + + $lead->pipeline_stage_id = request('stage_id'); + $lead->save(); + + return response()->json(200); + } + } diff --git a/src/resources/js/components/Lead/LeadCampaign.vue b/src/resources/js/components/Lead/LeadCampaign.vue index 4142aa5..80a196c 100644 --- a/src/resources/js/components/Lead/LeadCampaign.vue +++ b/src/resources/js/components/Lead/LeadCampaign.vue @@ -40,7 +40,8 @@ const props = defineProps({ const data = reactive({ route: props.routes, - emails: props.emails + emails: props.emails, + stages: props.stages }); provide('data', data); diff --git a/src/resources/js/components/Lead/OffCanvas.vue b/src/resources/js/components/Lead/OffCanvas.vue index d490090..219eb72 100644 --- a/src/resources/js/components/Lead/OffCanvas.vue +++ b/src/resources/js/components/Lead/OffCanvas.vue @@ -145,6 +145,18 @@ +