1
0
Fork 0
mirror of synced 2024-05-20 20:52:36 +12:00

Removed prefs merge behaviour

This commit is contained in:
Eldad Fux 2020-08-09 18:00:09 +03:00
parent 86593ea545
commit a7a55821a1
3 changed files with 9 additions and 18 deletions

View file

@ -30,8 +30,8 @@
## Breaking Changes (Read before upgrading!)
- **Deprecated** `first` and `last` query params for documents list route in the database API
- **Deprecated** Deprectaed Pubjabi Translations ('pn')
- **Deprecated** `PATCH /account/prefs` in favour of `PUT /account/prefs` route
- **Deprecated** `PATCH /users/:userId/prefs` in favour of `PUT /users/:userId/prefs` route
- **Deprecated** `PATCH /account/prefs` is now updating the prefs payload and not just merging it
- **Deprecated** `PATCH /users/:userId/prefs` is now updating the prefs payload and not just merging it
- Switched order of limit and offset params in all the SDKs `listDocuments` method for better consistency
- Default `limit` param value in all the SDKs `listDocuments` method is now 25 for better consistency

View file

@ -829,7 +829,7 @@ App::patch('/v1/account/email')
$response->dynamic($user, Response::MODEL_USER);
}, ['response', 'user', 'projectDB', 'audits']);
App::put('/v1/account/prefs')
App::patch('/v1/account/prefs')
->desc('Update Account Preferences')
->groups(['api', 'account'])
->label('event', 'account.update.prefs')

View file

@ -13,6 +13,7 @@ use Utopia\Config\Config;
use Appwrite\Auth\Auth;
use Appwrite\Auth\Validator\Password;
use Appwrite\Database\Database;
use Appwrite\Database\Document;
use Appwrite\Database\Exception\Duplicate;
use Appwrite\Database\Validator\UID;
use Appwrite\Utopia\Response;
@ -97,20 +98,10 @@ App::get('/v1/users')
],
]);
$results = \array_map(function ($value) { /* @var $value \Database\Document */
return $value->getArrayCopy(\array_merge(
[
'$id',
'status',
'email',
'registration',
'emailVerification',
'name',
],
));
}, $results);
$response->json(['sum' => $projectDB->getSum(), 'users' => $results]);
$response->dynamic(new Document([
'sum' => $projectDB->getSum(),
'users' => $results
]), Response::MODEL_FILE_LIST);
}, ['response', 'projectDB']);
App::get('/v1/users/:userId')
@ -341,7 +332,7 @@ App::patch('/v1/users/:userId/status')
$response->dynamic($user, Response::MODEL_USER);
}, ['response', 'projectDB']);
App::put('/v1/users/:userId/prefs')
App::patch('/v1/users/:userId/prefs')
->desc('Update User Preferences')
->groups(['api', 'users'])
->label('scope', 'users.write')