Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SSHOC
sshoc-marketplace-frontend
Commits
8babf1eb
Commit
8babf1eb
authored
Jul 02, 2021
by
Stefan Probst
Browse files
fix: handle missing contribute pages folder
parent
4cba5204
Pipeline
#208657
failed with stages
in 12 minutes and 46 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/pages/contribute/[id].tsx
View file @
8babf1eb
...
@@ -79,10 +79,14 @@ export async function getStaticProps(
...
@@ -79,10 +79,14 @@ export async function getStaticProps(
}
}
async
function
getContributePageIds
()
{
async
function
getContributePageIds
()
{
const
ids
=
(
await
fs
.
readdir
(
folder
,
'
utf-8
'
)).
map
((
fileName
)
=>
{
try
{
return
fileName
.
slice
(
0
,
-
extension
.
length
)
const
ids
=
(
await
fs
.
readdir
(
folder
,
'
utf-8
'
)).
map
((
fileName
)
=>
{
})
return
fileName
.
slice
(
0
,
-
extension
.
length
)
return
ids
})
return
ids
}
catch
{
return
[]
}
}
}
async
function
getContributePageById
(
id
:
string
)
{
async
function
getContributePageById
(
id
:
string
)
{
...
...
src/utils/contributePages.preval.ts
View file @
8babf1eb
...
@@ -22,10 +22,14 @@ async function getContributePageRoutes() {
...
@@ -22,10 +22,14 @@ async function getContributePageRoutes() {
}
}
async
function
getContributePageIds
()
{
async
function
getContributePageIds
()
{
const
ids
=
(
await
fs
.
readdir
(
folder
,
'
utf-8
'
)).
map
((
fileName
)
=>
{
try
{
return
fileName
.
slice
(
0
,
-
extension
.
length
)
const
ids
=
(
await
fs
.
readdir
(
folder
,
'
utf-8
'
)).
map
((
fileName
)
=>
{
})
return
fileName
.
slice
(
0
,
-
extension
.
length
)
return
ids
})
return
ids
}
catch
{
return
[]
}
}
}
async
function
getContributePageMetadataById
(
id
:
string
)
{
async
function
getContributePageMetadataById
(
id
:
string
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment