Skip to content

Commit

Permalink
removed default value for slug in faq_kb model
Browse files Browse the repository at this point in the history
removed slug after publish
  • Loading branch information
Giovanni Troisi committed Jan 22, 2025
1 parent 1c0577d commit 6c93b67
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion models/faq_kb.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ var Faq_kbSchema = new Schema({
slug: {
type: String,
required: false,
default: "",
index: true
},
},{
Expand Down
2 changes: 1 addition & 1 deletion routes/faq_kb.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ router.put('/:faq_kbid/publish', roleChecker.hasRole('admin'), async (req, res)
let forkedChatBotId = forked.bot_id;
winston.debug("forkedChatBotId: "+forkedChatBotId);

let updatedForkedChabot = await Faq_kb.findByIdAndUpdate(forkedChatBotId, {trashed: true, publishedBy: req.user.id, publishedAt: new Date().getTime()}, { new: true, upsert: true }).exec();
let updatedForkedChabot = await Faq_kb.findByIdAndUpdate(forkedChatBotId, { $unset: { slug: 1 }, trashed: true, publishedBy: req.user.id, publishedAt: new Date().getTime()}, { new: true, upsert: true }).exec();
winston.debug("updatedForkedChabot: ",updatedForkedChabot);
botEvent.emit('faqbot.update', updatedForkedChabot);

Expand Down

0 comments on commit 6c93b67

Please sign in to comment.