我在第14行遇到一个错误
请求文件,
错误是:未定义
import { Request, Response } from 'express'
import path from 'path'
import Photo from '../models/Photo';
export function getPhoto(req: Request, res: Response){
}
export async function createPhoto(req: Request, res: Response) {
const {title, description} = req.body;
const newPhoto = {
title: title,
description: description,
imagePath: req.file.path
};
const photo = new Photo(newPhoto);
await photo.save();
return res.json({
message: 'Foto creada correctamente',
photo
})
}
更多关于我的github:link的代码
我怎么能修理?
暂无答案!
目前还没有任何答案,快来回答吧!