mirror of
				https://github.com/DerTyp7/explainegy-nextjs.git
				synced 2025-10-31 05:37:12 +01:00 
			
		
		
		
	add markdown component
This commit is contained in:
		
							
								
								
									
										12
									
								
								pages/api/articles/create.tsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								pages/api/articles/create.tsx
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| import { Request, Response } from "express"; | ||||
| import prisma from "../../../lib/prisma"; | ||||
| import { Prisma } from "@prisma/client"; | ||||
| import { Article, Category } from "@prisma/client"; | ||||
| import { ResponseError } from "../../../types/responseErrors"; | ||||
|  | ||||
| export default async function handler(req: Request, res: Response) { | ||||
|   res.setHeader("Content-Type", "application/json"); | ||||
|  | ||||
|   await prisma.article.create({ data: req.body }); | ||||
|   console.log(); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Janis
					Janis