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

추가 변경 사항

parent 14bcff90
......@@ -4,7 +4,6 @@ import { mainimgApi } from "../apis";
// import { profileUpload } from "../apis/profile.api";
import { catchErrors } from "../helpers";
import { MainimgType } from "../types";
import { picture } from "../apis/profile.api";
import { MySlide } from "./adminslide";
// export interface ImgState {
......
......@@ -38,7 +38,7 @@ export const updateOneMainimg = async (
) => {
const newMainimg = await Mainimg.findById(_Id);
console.log("error2", _Id);
if (!(newMainimg?.pic === undefined)) {
if (!(newMainimg?.fileInfo === undefined)) {
if (originalfilename === undefined) {
await Mainimg.findByIdAndUpdate(newMainimg._id, {
theme: theme,
......@@ -57,13 +57,13 @@ export const updateOneMainimg = async (
city: city,
title: title,
});
await FileInfo.findByIdAndUpdate(newMainimg.pic._id, {
await FileInfo.findByIdAndUpdate(newMainimg.fileInfo._id, {
originalfilename: originalfilename,
newfilename: newfilename,
});
console.log("error6");
} else {
await FileInfo.findByIdAndUpdate(newMainimg.pic._id, {
await FileInfo.findByIdAndUpdate(newMainimg.fileInfo._id, {
originalfilename: originalfilename,
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