oneday-core
Advanced tools
Comparing version 1.0.35 to 1.0.36
10
db.js
@@ -98,3 +98,3 @@ const aws = require('aws-sdk'); | ||
async function create(params, topicName, requestId, isPublish = true) { | ||
async function create(params, requestId, isPublish = true, topicName = process.env.eventTopic) { | ||
@@ -110,5 +110,2 @@ const now = new Date().toISOString(); | ||
if (isPublish === true) { | ||
if (topicName === null) { | ||
topicName = process.env.eventTopic; | ||
} | ||
await resource.publishToTopic(topicName, enums.event_type.CREATE, params, requestId, []); | ||
@@ -127,3 +124,3 @@ } | ||
async function update(params, topicName, requestId, isPublish = true) { | ||
async function update(params, requestId, isPublish = true, topicName = process.env.eventTopic) { | ||
const now = new Date().toISOString(); | ||
@@ -143,5 +140,2 @@ const expr = params.UpdateExpression; | ||
if (isPublish === true) { | ||
if (topicName === null) { | ||
topicName = process.env.eventTopic; | ||
} | ||
await resource.publishToTopic(topicName, enums.event_type.UPDATE, params, requestId, []); | ||
@@ -148,0 +142,0 @@ } |
{ | ||
"name": "oneday-core", | ||
"version": "1.0.35", | ||
"version": "1.0.36", | ||
"description": "Basic AWS util functions to ease development.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
22966
625