Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const addOrUpdateImageInTable = (url, device, browser, otherInfo) => {
- console.log(`i am gonna do shit`)
- otherInfo = otherInfo ? otherInfo : {};
- return getItemPromise(getDynamoDBTableName(url), getDeviceBrowserKey(device, browser), url, {})
- .then((res) => {
- if (res) { // means the element exists, so we should update
- console.log(`res is ${res} so gonna update`)
- return updateImageInTable(url, device, browser, otherInfo);
- } else { // since it does not exist, let us create new one
- console.log(`res is ${res} so gonna create`);
- return addImageInTable(url, device, browser, otherInfo);
- }
- })
- .catch((err) => console.log(err))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement