Feat: News in the client app (#34392)
This commit is contained in:
18
client/utils/news.js
Normal file
18
client/utils/news.js
Normal file
@@ -0,0 +1,18 @@
|
||||
exports.createArticleSlug = ({
|
||||
username = '',
|
||||
slugPart = '',
|
||||
shortId = ''
|
||||
} = {}) => {
|
||||
if (!username || !slugPart || !shortId) {
|
||||
throw new Error(`
|
||||
createArtcileSlug: One or more properties were missing, all are required
|
||||
|
||||
{
|
||||
username: ${username},
|
||||
slugPart: ${slugPart},
|
||||
shortId: ${shortId}
|
||||
}
|
||||
`);
|
||||
}
|
||||
return `/news/${username}/${slugPart.concat('--', shortId)}`;
|
||||
};
|
Reference in New Issue
Block a user