Commit 769ea9f4 authored by Lee Soobeom's avatar Lee Soobeom
Browse files

추가 변경 사항

parent 14bcff90
...@@ -4,7 +4,6 @@ import { mainimgApi } from "../apis"; ...@@ -4,7 +4,6 @@ import { mainimgApi } from "../apis";
// import { profileUpload } from "../apis/profile.api"; // import { profileUpload } from "../apis/profile.api";
import { catchErrors } from "../helpers"; import { catchErrors } from "../helpers";
import { MainimgType } from "../types"; import { MainimgType } from "../types";
import { picture } from "../apis/profile.api";
import { MySlide } from "./adminslide"; import { MySlide } from "./adminslide";
// export interface ImgState { // export interface ImgState {
......
...@@ -38,7 +38,7 @@ export const updateOneMainimg = async ( ...@@ -38,7 +38,7 @@ export const updateOneMainimg = async (
) => { ) => {
const newMainimg = await Mainimg.findById(_Id); const newMainimg = await Mainimg.findById(_Id);
console.log("error2", _Id); console.log("error2", _Id);
if (!(newMainimg?.pic === undefined)) { if (!(newMainimg?.fileInfo === undefined)) {
if (originalfilename === undefined) { if (originalfilename === undefined) {
await Mainimg.findByIdAndUpdate(newMainimg._id, { await Mainimg.findByIdAndUpdate(newMainimg._id, {
theme: theme, theme: theme,
...@@ -57,13 +57,13 @@ export const updateOneMainimg = async ( ...@@ -57,13 +57,13 @@ export const updateOneMainimg = async (
city: city, city: city,
title: title, title: title,
}); });
await FileInfo.findByIdAndUpdate(newMainimg.pic._id, { await FileInfo.findByIdAndUpdate(newMainimg.fileInfo._id, {
originalfilename: originalfilename, originalfilename: originalfilename,
newfilename: newfilename, newfilename: newfilename,
}); });
console.log("error6"); console.log("error6");
} else { } else {
await FileInfo.findByIdAndUpdate(newMainimg.pic._id, { await FileInfo.findByIdAndUpdate(newMainimg.fileInfo._id, {
originalfilename: originalfilename, originalfilename: originalfilename,
newfilename: newfilename, newfilename: newfilename,
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment