Skip to content

Commit

Permalink
Fix an issue where the phone number first char was removed
Browse files Browse the repository at this point in the history
fix an issue on updating a queteur that is not a RCQ User (linked to previous fix to sync nivol udpate on user)
  • Loading branch information
dev-mansonthomas committed May 10, 2022
1 parent d24a4c2 commit a154a5c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/app/queteurs/edit/queteurEdit.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
}
try
{
vm.current.mobile = parseInt(vm.current.mobile.slice(1));
vm.current.mobile = parseInt(vm.current.mobile.charAt(0) ==='+' ? vm.current.mobile.slice(1):vm.current.mobile);
}
catch(e)
{
Expand Down
2 changes: 2 additions & 0 deletions server/phinx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
php vendor/bin/phinx migrate -e local-testing
2 changes: 1 addition & 1 deletion server/src/routes/routesActions/queteurs/UpdateQueteur.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function action(): Response
//restore the leading +
$queteurEntity->mobile = "+".$queteurEntity->mobile;
$this->queteurDBService->update($queteurEntity, $ulId, $roleId, $userId);
if($queteurEntity->nivol != $oldQueteurEntity->nivol)
if($queteurEntity->nivol != $oldQueteurEntity->nivol && array_key_exists('user' , $this->parsedBody) && $this->parsedBody['user']['id']>0)
{
$user = $this->userDBService->getUserInfoWithQueteurId($queteurEntity->id, $ulId, $roleId);
$this->userDBService->updateNivol($user->id, $queteurEntity->nivol, $ulId, $roleId);
Expand Down

0 comments on commit a154a5c

Please sign in to comment.