This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// we use this variable to keep track of the db insertion being successful or not | |
let result = null; | |
let counter = 0; | |
do { | |
try { | |
// Handle singular item | |
const title = newItems.title; | |
const slug = slugify(`${title}${counter ? '-' + counter : ''}`, { | |
lower: true, | |
strict: true, |