@kne/fastify-account 1.0.0-alpha.4 → 1.0.0-alpha.5
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/README.md +2 -2
- package/libs/services/tenant-user.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ npm i --save @kne/fastify-account
|
|
|
22
22
|
### API
|
|
23
23
|
|
|
24
24
|
---
|
|
25
|
-
title: "@kne/fastify-account v1.0.0-alpha.
|
|
25
|
+
title: "@kne/fastify-account v1.0.0-alpha.4"
|
|
26
26
|
language_tabs:
|
|
27
27
|
- shell: Shell
|
|
28
28
|
- http: HTTP
|
|
@@ -42,7 +42,7 @@ headingLevel: 2
|
|
|
42
42
|
|
|
43
43
|
<!-- Generator: Widdershins v4.0.1 -->
|
|
44
44
|
|
|
45
|
-
<h1 id="-kne-fastify-account">@kne/fastify-account v1.0.0-alpha.
|
|
45
|
+
<h1 id="-kne-fastify-account">@kne/fastify-account v1.0.0-alpha.4</h1>
|
|
46
46
|
|
|
47
47
|
> Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
|
|
48
48
|
|
|
@@ -116,8 +116,8 @@ module.exports = fp(async (fastify, options) => {
|
|
|
116
116
|
const currentTenant = currentTenantUser && tenantList.find(({ uuid }) => uuid === currentTenantUser.tenantId);
|
|
117
117
|
|
|
118
118
|
return {
|
|
119
|
-
currentTenant: currentTenant && Object.assign({}, currentTenant, { id: currentTenant.uuid }),
|
|
120
|
-
currentTenantUser: currentTenantUser && Object.assign({}, currentTenantUser, { id: currentTenantUser.uuid }),
|
|
119
|
+
currentTenant: currentTenant && Object.assign({}, currentTenant.get({ plain: true }), { id: currentTenant.uuid }),
|
|
120
|
+
currentTenantUser: currentTenantUser && Object.assign({}, currentTenantUser.get({ plain: true }), { id: currentTenantUser.uuid }),
|
|
121
121
|
tenantList: tenantList.map(item => {
|
|
122
122
|
return Object.assign({}, item.get({ plain: true }), { id: item.uuid });
|
|
123
123
|
}),
|
|
@@ -148,7 +148,7 @@ module.exports = fp(async (fastify, options) => {
|
|
|
148
148
|
const tenant = await services.tenant.getTenant({ id: user.currentTenantId });
|
|
149
149
|
|
|
150
150
|
const tenantUser = await models.tenantUser.findOne({
|
|
151
|
-
attributes: ['uuid', 'avatar', 'description', 'phone', 'email'],
|
|
151
|
+
attributes: ['uuid', 'avatar', 'name', 'description', 'phone', 'email'],
|
|
152
152
|
include: [
|
|
153
153
|
{
|
|
154
154
|
attributes: ['id', 'name'],
|