PostgreSQL 데이터 계층 추가
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { getSamplePostBySlug } from '../../utils/sample-content'
|
||||
import { getPostBySlug } from '../../repositories/content-repository'
|
||||
|
||||
/**
|
||||
* 공개 게시물 상세 API
|
||||
* @param {import('h3').H3Event} event - 요청 이벤트
|
||||
* @returns {Object} 게시물 상세
|
||||
*/
|
||||
export default defineEventHandler((event) => {
|
||||
export default defineEventHandler(async (event) => {
|
||||
const slug = getRouterParam(event, 'slug')
|
||||
const post = getSamplePostBySlug(slug)
|
||||
const post = await getPostBySlug(slug)
|
||||
|
||||
if (!post) {
|
||||
throw createError({
|
||||
|
||||
Reference in New Issue
Block a user