mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
refactored publicCreate
This commit is contained in:
@@ -176,28 +176,30 @@ describe('services.AssetsService', () => {
|
||||
);
|
||||
|
||||
// Create some comments on both assets.
|
||||
await CommentsService.publicCreate([
|
||||
{
|
||||
asset_id: '1',
|
||||
body: 'This is a comment!',
|
||||
status: 'ACCEPTED',
|
||||
},
|
||||
{
|
||||
asset_id: '1',
|
||||
body: 'This is a comment!',
|
||||
status: 'ACCEPTED',
|
||||
},
|
||||
{
|
||||
asset_id: '2',
|
||||
body: 'This is a comment!',
|
||||
status: 'ACCEPTED',
|
||||
},
|
||||
{
|
||||
asset_id: '2',
|
||||
body: 'This is a comment!',
|
||||
status: 'ACCEPTED',
|
||||
},
|
||||
]);
|
||||
await Promise.all(
|
||||
[
|
||||
{
|
||||
asset_id: '1',
|
||||
body: 'This is a comment!',
|
||||
status: 'ACCEPTED',
|
||||
},
|
||||
{
|
||||
asset_id: '1',
|
||||
body: 'This is a comment!',
|
||||
status: 'ACCEPTED',
|
||||
},
|
||||
{
|
||||
asset_id: '2',
|
||||
body: 'This is a comment!',
|
||||
status: 'ACCEPTED',
|
||||
},
|
||||
{
|
||||
asset_id: '2',
|
||||
body: 'This is a comment!',
|
||||
status: 'ACCEPTED',
|
||||
},
|
||||
].map(comment => CommentsService.publicCreate(comment))
|
||||
);
|
||||
|
||||
// Merge all the comments from asset 1 into asset 2, followed by deleting
|
||||
// asset 1.
|
||||
|
||||
Reference in New Issue
Block a user