Add Activity id if missing
This commit is contained in:
parent
edb61e52c5
commit
92828028db
1 changed files with 16 additions and 7 deletions
|
@ -1,7 +1,16 @@
|
||||||
export default (x: any) => Object.assign({
|
import config from '../../../config';
|
||||||
'@context': [
|
import * as uuid from 'uuid';
|
||||||
'https://www.w3.org/ns/activitystreams',
|
|
||||||
'https://w3id.org/security/v1',
|
export default (x: any) => {
|
||||||
{ Hashtag: 'as:Hashtag' }
|
if (x !== null && typeof x === 'object' && x.id == null) {
|
||||||
]
|
x.id = `${config.url}/${uuid.v4()}`;
|
||||||
}, x);
|
}
|
||||||
|
|
||||||
|
return Object.assign({
|
||||||
|
'@context': [
|
||||||
|
'https://www.w3.org/ns/activitystreams',
|
||||||
|
'https://w3id.org/security/v1',
|
||||||
|
{ Hashtag: 'as:Hashtag' }
|
||||||
|
]
|
||||||
|
}, x);
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in a new issue