misc updates with tests failing

This commit is contained in:
Mark Gregory
2026-06-29 09:42:00 +01:00
parent 7b40a55b0e
commit eaa8c6ebe3
6 changed files with 132 additions and 183 deletions
+45 -1
View File
@@ -86,10 +86,54 @@ final class TicketCreate extends Component
$this->applyDefaults();
}
public function save(TicketService $tickets)
{
logger()->info('SAVE START');
try {
logger()->info('VALIDATING');
$this->validate();
logger()->info('VALIDATED');
logger()->info([
'attachments' => count($this->attachments),
'body' => $this->body,
]);
$ticket = $tickets->create(Auth::user(), [
'company_id' => $this->company_id,
'subject' => $this->subject,
'body' => $this->body,
'board_id' => $this->board_id,
'priority_id' => $this->priority_id,
'category_id' => $this->category_id,
'project_id' => $this->project_id,
'product_id' => $this->product_id,
'team_id' => $this->team_id,
'due_at' => $this->due_at,
'tag_ids' => $this->tag_ids,
], $this->attachments);
session()->flash('success', 'Ticket ' . $ticket->reference . ' has been created.');
logger()->info('CREATED '.$ticket->id);
return redirect()->route('helpdesk.tickets.index');
} catch (\Throwable $e) {
logger()->error($e);
throw $e;
}
}
/**
* Store a new helpdesk ticket.
*/
public function save(TicketService $tickets)
public function save_old(TicketService $tickets)
{
if ($this->isSaving) {
return null;