refactor: server code (#2545)

+ Remove duplicated await
+ Replace some legacy codes with ES6
+ Fix some of eslint problems
This commit is contained in:
Jafar Akhondali
2020-10-14 18:46:27 +03:30
committed by GitHub
parent 0a1f0ac9e3
commit 5ba36ee421
12 changed files with 27 additions and 39 deletions

View File

@@ -7,7 +7,7 @@ describe('helpers/page/injectPageMetadata', () => {
isPublished: true,
updatedAt: new Date(),
content: 'TEST CONTENT',
createdAt: new Date('2019-01-01'),
createdAt: new Date('2019-01-01')
}
it('returns the page content by default when content type is unknown', () => {
@@ -20,7 +20,7 @@ describe('helpers/page/injectPageMetadata', () => {
const markdownPage = {
...page,
contentType: 'markdown',
editorKey: 'markdown',
editorKey: 'markdown'
}
const expected = `---
@@ -42,7 +42,7 @@ TEST CONTENT`
const htmlPage = {
...page,
contentType: 'html',
editorKey: 'html',
editorKey: 'html'
}
const expected = `<!--