Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
Resin
Server
Commits
96002256
Commit
96002256
authored
2 years ago
by
Guilhem CARRON
Browse files
Options
Downloads
Patches
Plain Diff
fix(annuaire): Fix case one job an no employer for user
parent
49fe50e8
No related branches found
No related tags found
3 merge requests
!247
V2.1.0
,
!242
V2.0
,
!127
V2.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/users/services/userRegistry.service.ts
+5
-4
5 additions, 4 deletions
src/users/services/userRegistry.service.ts
with
5 additions
and
4 deletions
src/users/services/userRegistry.service.ts
+
5
−
4
View file @
96002256
...
...
@@ -60,19 +60,20 @@ export class UserRegistryService {
const
employersNames
:
string
[]
=
employersList
.
map
((
e
)
=>
e
.
name
);
// For each filter list (job or employer), we'll filter the main user list in order to get only the user that have a job or employer contained in the filters array
// For this, we une findexIndex method on job/employer name
if
(
employersList
?.
length
&&
jobList
?.
length
)
{
return
users
.
filter
(
(
user
)
=>
jobNames
.
findIndex
((
n
)
=>
user
.
job
.
name
===
n
)
>
-
1
&&
employersNames
.
findIndex
((
n
)
=>
user
.
employer
.
name
===
n
)
>
-
1
jobNames
.
findIndex
((
n
)
=>
user
.
job
?
.
name
===
n
)
>
-
1
&&
employersNames
.
findIndex
((
n
)
=>
user
.
employer
?
.
name
===
n
)
>
-
1
);
}
if
(
employersList
?.
length
)
{
return
users
.
filter
((
user
)
=>
employersNames
.
findIndex
((
n
)
=>
user
.
employer
.
name
===
n
)
>
-
1
);
return
users
.
filter
((
user
)
=>
employersNames
.
findIndex
((
n
)
=>
user
.
employer
?
.
name
===
n
)
>
-
1
);
}
if
(
jobList
?.
length
)
{
return
users
.
filter
((
user
)
=>
jobNames
.
findIndex
((
n
)
=>
user
.
job
.
name
===
n
)
>
-
1
);
return
users
.
filter
((
user
)
=>
jobNames
.
findIndex
((
n
)
=>
user
.
job
?
.
name
===
n
)
>
-
1
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment