mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: hotfix for empty user fields
This commit is contained in:
@@ -69,9 +69,10 @@ Mocks.profile = async (actors, hostMap) => {
|
|||||||
bgColor = iconBackgrounds[bgColor % iconBackgrounds.length];
|
bgColor = iconBackgrounds[bgColor % iconBackgrounds.length];
|
||||||
|
|
||||||
// Add custom fields into user hash
|
// Add custom fields into user hash
|
||||||
const customFields = actor.attachment
|
const customFields = actor.attachment ? actor.attachment
|
||||||
.filter(attachment => attachment.type === 'PropertyValue')
|
.filter(attachment => attachment.type === 'PropertyValue')
|
||||||
.reduce((map, { name, value }) => map.set(name, value), new Map());
|
.reduce((map, { name, value }) => map.set(name, value), new Map()) :
|
||||||
|
undefined;
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
uid,
|
uid,
|
||||||
@@ -95,7 +96,7 @@ Mocks.profile = async (actors, hostMap) => {
|
|||||||
inbox,
|
inbox,
|
||||||
sharedInbox: endpoints ? endpoints.sharedInbox : null,
|
sharedInbox: endpoints ? endpoints.sharedInbox : null,
|
||||||
followersUrl: followers,
|
followersUrl: followers,
|
||||||
customFields: new URLSearchParams(customFields).toString(),
|
customFields: customFields && new URLSearchParams(customFields).toString(),
|
||||||
};
|
};
|
||||||
|
|
||||||
return payload;
|
return payload;
|
||||||
|
|||||||
Reference in New Issue
Block a user