Make sure "Block" object only stores strings (not array) in "actor|object"
* This is done so we can faster search for blocks without using $elemMatch on mongodb
This commit is contained in:
parent
c7d8a075b9
commit
629de2d8b7
|
@ -46,8 +46,15 @@ module.exports = {
|
|||
}
|
||||
if (msg.activity.type === 'Block')
|
||||
{
|
||||
if (areActorsValid(msg.activity.object, true))
|
||||
if (areActorsValid(msg.activity.object, true)) {
|
||||
if (msg.activity.actor instanceof Array &&
|
||||
msg.activity.actor.length > 0)
|
||||
msg.activity.actor = msg.activity.actor[0]
|
||||
if (msg.activity.object instanceof Array &&
|
||||
msg.activity.object.length > 0)
|
||||
msg.activity.object = msg.activity.object[0]
|
||||
await apex.store.saveObject(msg.activity)
|
||||
}
|
||||
return true
|
||||
}
|
||||
if (msg.activity.type === 'Undo')
|
||||
|
|
Loading…
Reference in New Issue