Skip to content

Commit

Permalink
Merge pull request #25 from eurofurence/bugfix/trim-at-from-telegram-…
Browse files Browse the repository at this point in the history
…dect

fix(user): ltrim @ from dectelegram on create
  • Loading branch information
RustyBraze authored Sep 5, 2024
2 parents 243fd1b + f46ed0e commit a7fbd3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function saveProfile(Request $request): Response
}

if (config('enable_dect')) {
$user->contact->dect = ltrim($data['dect'], '@');
$user->contact->dect = array_key_exists('dect', $data) && !empty($data['dect']) ? ltrim($data['dect'], '@') : null;
}

$user->contact->mobile = $data['mobile'];
Expand Down
2 changes: 1 addition & 1 deletion src/Factories/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private function createUser(array $data, array $rawData): EngelsystemUser
$user->save();

$contact = new Contact([
'dect' => $data['dect'] ?? null,
'dect' => array_key_exists('dect', $data) && !empty($data['dect']) ? ltrim($data['dect'], '@') : null,
'mobile' => $data['mobile'],
]);
$contact->user()
Expand Down

0 comments on commit a7fbd3a

Please sign in to comment.