Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gdd-sigma-poc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guillaume WANG
gdd-sigma-poc
Commits
a386f722
Commit
a386f722
authored
6 years ago
by
Olivér FACKLAM
Browse files
Options
Downloads
Patches
Plain Diff
Modif userData, groupData en classe
parent
aa8808ed
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/graphql/models/userModel.ts
+35
-36
35 additions, 36 deletions
src/graphql/models/userModel.ts
with
35 additions
and
36 deletions
src/graphql/models/userModel.ts
+
35
−
36
View file @
a386f722
...
...
@@ -47,19 +47,19 @@ export class UserModel {
* @rights connectedOrOnplatal
*/
async
searchTOL
(
args
:
searchTOLArgs
):
Promise
<
User
[]
>
{
const
searchData
:
userData
=
{
givenName
:
args
.
givenName
,
lastName
:
args
.
lastName
,
nickname
:
args
.
nickname
,
nationality
:
args
.
nationality
,
promotion
:
args
.
promotion
,
groups
:
args
.
groups
,
sport
:
args
.
sport
,
phone
:
args
.
phone
,
mail
:
args
.
mail
,
address
:
args
.
addresses
[
0
]
,
ips
:
args
.
ips
}
const
searchData
=
new
userData
();
searchData
.
givenName
=
args
.
givenName
;
searchData
.
lastName
=
args
.
lastName
;
searchData
.
nickname
=
args
.
nickname
;
searchData
.
nationality
=
args
.
nationality
;
searchData
.
promotion
=
args
.
promotion
;
searchData
.
groups
=
args
.
groups
;
searchData
.
sport
=
args
.
sport
;
searchData
.
phone
=
args
.
phone
;
searchData
.
mail
=
args
.
mail
;
searchData
.
address
=
args
.
addresses
[
0
]
;
searchData
.
ips
=
args
.
ips
;
const
userList
=
await
UT
.
search
(
searchData
);
return
userList
.
map
((
uid
)
=>
new
User
(
uid
));
}
...
...
@@ -77,29 +77,28 @@ export class UserModel {
let
data
=
await
UT
.
peek
(
this
.
contextUser
);
//Modify some fields, keep the others
let
editArgs
:
userData
=
{
uid
:
data
.
uid
,
groups
:
data
.
groups
,
groupsIsAdmin
:
data
.
groupsIsAdmin
,
password
:
data
.
password
,
givenName
:
data
.
givenName
,
lastName
:
data
.
lastName
,
nickname
:
args
.
nickname
,
// <- this field is modified by user
promotion
:
data
.
promotion
,
photo
:
data
.
photo
,
birthdate
:
data
.
birthdate
,
nationality
:
data
.
nationality
,
phone
:
args
.
phone
,
// <- this field is modified
address
:
data
.
address
,
// WTF why can't this be changed ????
mail
:
args
.
mail
,
// <- this field is modified
ips
:
data
.
ips
,
directory
:
data
.
directory
,
login
:
data
.
login
,
readPerm
:
data
.
readPerm
,
writePerm
:
data
.
writePerm
,
forlifes
:
data
.
forlifes
,
sport
:
data
.
sport
};
let
editArgs
=
new
userData
();
editArgs
.
uid
=
data
.
uid
;
editArgs
.
groups
=
data
.
groups
;
editArgs
.
groupsIsAdmin
=
data
.
groupsIsAdmin
;
editArgs
.
password
=
data
.
password
;
editArgs
.
givenName
=
data
.
givenName
;
editArgs
.
lastName
=
data
.
lastName
;
editArgs
.
nickname
=
args
.
nickname
;
// <- this field is modified by user
editArgs
.
promotion
=
data
.
promotion
;
editArgs
.
photo
=
data
.
photo
;
editArgs
.
birthdate
=
data
.
birthdate
;
editArgs
.
nationality
=
data
.
nationality
;
editArgs
.
phone
=
args
.
phone
;
// <- this field is modified
editArgs
.
address
=
data
.
address
;
// WTF why can't this be changed ????
editArgs
.
mail
=
args
.
mail
;
// <- this field is modified
editArgs
.
ips
=
data
.
ips
;
editArgs
.
directory
=
data
.
directory
;
editArgs
.
login
=
data
.
login
;
editArgs
.
readPerm
=
data
.
readPerm
;
editArgs
.
writePerm
=
data
.
writePerm
;
editArgs
.
forlifes
=
data
.
forlifes
;
editArgs
.
sport
=
data
.
sport
;
if
(
await
UT
.
edit
(
editArgs
))
{
return
new
User
(
data
.
uid
);
...
...
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