Skip to content

Commit

Permalink
fix: utilize user session with api key call
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemcshea committed Jul 24, 2024
1 parent bdc885f commit e2dac9a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/Domain/Tickets/Services/Tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -1232,16 +1232,14 @@ public function quickAddMilestone($params): array|bool|int
*/
public function addTicket($values)
{
$userId = $values['userId'] ?? session("userdata.id");

$values = array(
'id' => '',
'headline' => $values['headline'] ?? "",
'type' => $values['type'] ?? "task",
'description' => $values['description'] ?? "",
'projectId' => $values['projectId'] ?? session("currentProject"),
'editorId' => $values['editorId'] ?? "",
'userId' => $userId,
'userId' => session("userdata.id"),
'date' => gmdate("Y-m-d H:i:s"),
'dateToFinish' => $values['dateToFinish'] ?? "",
'timeToFinish' => $values['timeToFinish'] ?? "",
Expand All @@ -1261,7 +1259,7 @@ public function addTicket($values)
'milestoneid' => $values['milestoneid'] ?? "",
);

if (!$this->projectService->isUserAssignedToProject($userId, $values['projectId'])) {
if (!$this->projectService->isUserAssignedToProject(session("userdata.id"), $values['projectId'])) {
return array("msg" => "notifications.ticket_save_error_no_access", "type" => "error");
}

Expand Down

0 comments on commit e2dac9a

Please sign in to comment.