mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-29 08:07:48 +01:00
slugify in model
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
const express = require('express');
|
||||
const mongoose = require('mongoose');
|
||||
const slugify = require('slugify');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
@@ -27,7 +26,6 @@ router.post(
|
||||
asyncHelper(async (req, res) => {
|
||||
const { name } = req.body;
|
||||
const newList = new TodoList({ name });
|
||||
newList.slug = slugify(name);
|
||||
await newList.save();
|
||||
res.json({ success: true });
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user