mirror of https://github.com/MaxLeiter/Drift
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			17 lines
		
	
	
		
			410 B
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			17 lines
		
	
	
		
			410 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}`
 | 
						|
		default:
 | 
						|
			console.error(`Unknown visibility: ${visibility}`)
 | 
						|
			return `/post/${id}`
 | 
						|
	}
 | 
						|
}
 |