diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-06-08 14:25:44 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2017-06-08 14:25:44 +0200 |
commit | a8d3fe50df52ec486add5691a3b67fe5205a032e (patch) | |
tree | 77b9464d3417658eca7150875ef0ad0a26f63f05 /src/Wallabag/ApiBundle/Controller/UserRestController.php | |
parent | eb570e49c8e3ba12638fac600bb5527191c2aaa2 (diff) | |
download | wallabag-a8d3fe50df52ec486add5691a3b67fe5205a032e.tar.gz wallabag-a8d3fe50df52ec486add5691a3b67fe5205a032e.tar.zst wallabag-a8d3fe50df52ec486add5691a3b67fe5205a032e.zip |
Add ability to name the client
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller/UserRestController.php')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/UserRestController.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/UserRestController.php b/src/Wallabag/ApiBundle/Controller/UserRestController.php index becbbb9e..7471f5f6 100644 --- a/src/Wallabag/ApiBundle/Controller/UserRestController.php +++ b/src/Wallabag/ApiBundle/Controller/UserRestController.php | |||
@@ -28,13 +28,14 @@ class UserRestController extends WallabagRestController | |||
28 | } | 28 | } |
29 | 29 | ||
30 | /** | 30 | /** |
31 | * Register an user. | 31 | * Register an user and create a client. |
32 | * | 32 | * |
33 | * @ApiDoc( | 33 | * @ApiDoc( |
34 | * requirements={ | 34 | * requirements={ |
35 | * {"name"="username", "dataType"="string", "required"=true, "description"="The user's username"}, | 35 | * {"name"="username", "dataType"="string", "required"=true, "description"="The user's username"}, |
36 | * {"name"="password", "dataType"="string", "required"=true, "description"="The user's password"}, | 36 | * {"name"="password", "dataType"="string", "required"=true, "description"="The user's password"}, |
37 | * {"name"="email", "dataType"="string", "required"=true, "description"="The user's email"} | 37 | * {"name"="email", "dataType"="string", "required"=true, "description"="The user's email"}, |
38 | * {"name"="client_name", "dataType"="string", "required"=true, "description"="The client name (to be used by your app)"} | ||
38 | * } | 39 | * } |
39 | * ) | 40 | * ) |
40 | * | 41 | * |
@@ -100,7 +101,7 @@ class UserRestController extends WallabagRestController | |||
100 | 101 | ||
101 | // create a default client | 102 | // create a default client |
102 | $client = new Client($user); | 103 | $client = new Client($user); |
103 | $client->setName('Default client'); | 104 | $client->setName($request->request->get('client_name', 'Default client')); |
104 | 105 | ||
105 | $this->getDoctrine()->getManager()->persist($client); | 106 | $this->getDoctrine()->getManager()->persist($client); |
106 | 107 | ||