@docbrasil/api-systemmanager 1.0.63 → 1.0.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/user/user.js +30 -0
- package/dist/bundle.cjs +30 -0
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +23 -0
- package/package.json +1 -1
package/doc/api.md
CHANGED
|
@@ -1946,6 +1946,7 @@ Class for user, permission user
|
|
|
1946
1946
|
* [.removeSignature(session)](#User+removeSignature) ⇒ <code>Promise</code>
|
|
1947
1947
|
* [.saveSignature(data, session)](#User+saveSignature) ⇒ <code>Promise</code>
|
|
1948
1948
|
* [.findByIdAndUpdate(params, session)](#User+findByIdAndUpdate) ⇒ <code>Promise.<void></code>
|
|
1949
|
+
* [.changeOrganization(id, session)](#User+changeOrganization) ⇒ <code>Promise</code>
|
|
1949
1950
|
|
|
1950
1951
|
<a name="User+updateAvatar"></a>
|
|
1951
1952
|
|
|
@@ -2090,3 +2091,25 @@ const params = {
|
|
|
2090
2091
|
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
2091
2092
|
await api.user.profile.findByIdAndUpdate(params, session);
|
|
2092
2093
|
```
|
|
2094
|
+
<a name="User+changeOrganization"></a>
|
|
2095
|
+
|
|
2096
|
+
### user.changeOrganization(id, session) ⇒ <code>Promise</code>
|
|
2097
|
+
Change a user's organization
|
|
2098
|
+
|
|
2099
|
+
**Kind**: instance method of [<code>User</code>](#User)
|
|
2100
|
+
**Access**: public
|
|
2101
|
+
**Author**: CloudBrasil <abernardo.br@gmail.com>
|
|
2102
|
+
|
|
2103
|
+
| Param | Type | Description |
|
|
2104
|
+
| --- | --- | --- |
|
|
2105
|
+
| id | <code>string</code> | Organization id |
|
|
2106
|
+
| session | <code>string</code> | Is token JWT of user NOT allow SU |
|
|
2107
|
+
|
|
2108
|
+
**Example**
|
|
2109
|
+
```js
|
|
2110
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
2111
|
+
const api = new API();
|
|
2112
|
+
const id = '616eccaaa9360a05293b10fe';
|
|
2113
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
2114
|
+
await api.user.changeOrganization.updateAvatar(id, session);
|
|
2115
|
+
```
|
package/package.json
CHANGED