From 41a4de8f51dee5bfd530cce906618079c5ddc434 Mon Sep 17 00:00:00 2001 From: William Bagayoko Date: Fri, 15 Mar 2019 12:10:21 -0500 Subject: [PATCH] #962 Create WorkItem in sending user section sent outbox --- shared/src/persistence/dynamo/workitems/createWorkItem.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shared/src/persistence/dynamo/workitems/createWorkItem.js b/shared/src/persistence/dynamo/workitems/createWorkItem.js index 2bd9d793fd2..9c02a2753ba 100644 --- a/shared/src/persistence/dynamo/workitems/createWorkItem.js +++ b/shared/src/persistence/dynamo/workitems/createWorkItem.js @@ -13,6 +13,8 @@ const { * @returns {*} */ exports.createWorkItem = async ({ workItem, applicationContext }) => { + const user = applicationContext.getCurrentUser(); + // create the work item await put({ applicationContext, @@ -31,6 +33,7 @@ exports.createWorkItem = async ({ workItem, applicationContext }) => { type: 'workItem', }); + // sending user 'my' outbox await put({ applicationContext, Item: { @@ -48,10 +51,11 @@ exports.createWorkItem = async ({ workItem, applicationContext }) => { type: 'workItem', }); + // sending user section outbox await put({ applicationContext, Item: { - pk: `${workItem.section}|outbox`, + pk: `${user.section}|outbox`, sk: workItem.createdAt, ...workItem, },