14 lines
374 B
TypeScript
14 lines
374 B
TypeScript
|
import type { PostVisibility } from "./types"
|
||
|
|
||
|
export default function getPostPath(visibility: PostVisibility, id: string) {
|
||
|
switch (visibility) {
|
||
|
case "private":
|
||
|
return `/post/private/${id}`
|
||
|
case "protected":
|
||
|
return `/post/protected/${id}`
|
||
|
case "unlisted":
|
||
|
case "public":
|
||
|
return `/post/${id}`
|
||
|
}
|
||
|
}
|