Merge pull request 'dev' (#95) from dev into dev-deploy
Reviewed-on: #95
This commit is contained in:
commit
72bbf33317
@ -1,5 +1,5 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import { S3Client, CopyObjectCommand } from '@aws-sdk/client-s3'
|
||||
import { S3Client, CopyObjectCommand, GetObjectCommand } from '@aws-sdk/client-s3'
|
||||
import sharp from 'sharp'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
const Bucket = process.env.AMPLIFY_BUCKET
|
||||
@ -17,6 +17,23 @@ export async function POST(req) {
|
||||
|
||||
const responseArray = []
|
||||
|
||||
// const isExistImage1 = await s3.send(
|
||||
// new GetObjectCommand({
|
||||
// Bucket,
|
||||
// Key: `Drawing/${objectNo}_${planNo}_1.png`,
|
||||
// }),
|
||||
// )
|
||||
|
||||
// const isExistImage2 = await s3.send(
|
||||
// new GetObjectCommand({
|
||||
// Bucket,
|
||||
// Key: `Drawing/${objectNo}_${planNo}_1.png`,
|
||||
// }),
|
||||
// )
|
||||
|
||||
// console.log('🚀 ~ isExistImage1:', isExistImage1.$metadata.httpStatusCode === 200)
|
||||
// console.log('🚀 ~ isExistImage2:', isExistImage2.$metadata.httpStatusCode === 200)
|
||||
|
||||
const copyCommand = new CopyObjectCommand({
|
||||
Bucket,
|
||||
CopySource: encodeURI(`${Bucket}/Drawing/${objectNo}_${planNo}_1.png`),
|
||||
|
||||
@ -535,5 +535,6 @@ export const useEstimateController = (planNo, flag) => {
|
||||
handleEstimateFileDownload,
|
||||
handleEstimateCopy,
|
||||
handleDeleteEstimate,
|
||||
handleEstimateImageCopy,
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ export function usePlan(params = {}) {
|
||||
const { getMessage } = useMessage()
|
||||
const { get, post, promisePost, promisePut, promiseDel, promiseGet } = useAxios()
|
||||
|
||||
const { setEstimateContextState, handleDeleteEstimate } = useEstimateController()
|
||||
const { setEstimateContextState, handleDeleteEstimate, handleEstimateImageCopy } = useEstimateController()
|
||||
|
||||
const resetOuterLinePoints = useResetRecoilState(outerLinePointsState)
|
||||
const resetPlacementShapeDrawingPoints = useResetRecoilState(placementShapeDrawingPointsState)
|
||||
@ -79,7 +79,6 @@ export function usePlan(params = {}) {
|
||||
const resetCurrentObject = useResetRecoilState(currentObjectState)
|
||||
//선택된 모듈 배치면 초기화
|
||||
const resetModuleSetupSurface = useResetRecoilState(moduleSetupSurfaceState)
|
||||
|
||||
const { isAllComplete } = useTrestle()
|
||||
|
||||
/**
|
||||
@ -308,6 +307,9 @@ export function usePlan(params = {}) {
|
||||
setModuleSelectionDataStore(copyData)
|
||||
if (copyData.module) setSelectedModules(copyData.module)
|
||||
setSelectedMenu(currentSelectedMenu)
|
||||
|
||||
//이미지 복사
|
||||
handleEstimateImageCopy(planData.objectNo, planData.planNo, planData.objectNo, newPlan.planNo)
|
||||
} else {
|
||||
setSelectedMenu('placement')
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user