Skip to content

Commit 25f4414

Browse files
committed
fix code
1 parent cbfaa1d commit 25f4414

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/routes/v1/blog/editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import role from '../../../helpers/role';
1515
const router = express.Router();
1616

1717
/*-------------------------------------------------------------------------*/
18-
router.use(authentication, role(RoleCode.EDITOR), authorization);
18+
router.use(authentication, role(RoleCode.ADMIN, RoleCode.EDITOR), authorization);
1919
/*-------------------------------------------------------------------------*/
2020

2121
router.put(

src/routes/v1/blog/writer.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ router.put(
6868
if (req.body.title) blog.title = req.body.title;
6969
if (req.body.description) blog.description = req.body.description;
7070
if (req.body.text) blog.draftText = req.body.text;
71-
if (req.body.data) blog.draftData = req.body.data;
7271
if (req.body.tags) blog.tags = req.body.tags;
7372
if (req.body.imgUrl) blog.imgUrl = req.body.imgUrl;
7473
if (req.body.score) blog.score = req.body.score;
@@ -125,7 +124,6 @@ router.delete(
125124
blog.isDraft = false;
126125
// revert to the original state
127126
blog.draftText = blog.text;
128-
blog.draftData = blog.data;
129127
} else {
130128
blog.status = false;
131129
}

0 commit comments

Comments
 (0)