Skip to content

Commit

Permalink
softwareCatalog update issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsej108 committed Sep 30, 2024
1 parent 4ab5fdc commit 40a2647
Showing 1 changed file with 32 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ onMounted(async () => {
})
const setInit = async () => {
console.log("setInit props.catalogIdx : ", props.catalogIdx)
console.log("porps.mode : ", props.mode)
if(props.mode == 'update') {
await _getSoftwareCatalogDetail()
} else {
Expand Down Expand Up @@ -193,29 +191,48 @@ const handleFileChange = (event: any) => {
}
const createSoftwareCatalog = async () => {
if(props.mode == 'new') {
const formData = new FormData();
formData.append('iconFile', files.value);
catalogDto.value.catalogRefData = refData.value;
formData.append('catalogDto', new Blob([JSON.stringify(catalogDto.value)], {
type: 'application/json'
}));
const formData = new FormData();
formData.append('iconFile', files.value);
catalogDto.value.catalogRefData = refData.value;
formData.append('catalogDto', new Blob([JSON.stringify(catalogDto.value)], {
type: 'application/json'
}));
if(props.mode == 'new') {
const response = await axios.post(baseUrl + '/catalog/software', formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
});
if(response.data) {
toast.success('등록되었습니다.')
emit('get-list')
if(response.data.data == null) {
toast.error('등록 할 수 없습니다.')
setInit();
} else {
toast.success('등록되었습니다.')
emit('get-list')
}
} else {
toast.error('등록 할 수 없습니다.')
setInit();
}
} else {
const response = await axios.put(baseUrl + '/catalog/software')
const response = await axios.put(baseUrl + '/catalog/software', formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
});
if(response.data) {
toast.success('수정되었습니다.')
emit('get-list')
} else {
toast.error('수정 할 수 없습니다.')
setInit();
}
}
}
Expand Down

0 comments on commit 40a2647

Please sign in to comment.