feat(character): 캐릭터 삭제 API
- 삭제 API 호출 대신 isActive=false로 수정 API 호출하도록 변경
This commit is contained in:
parent
6bd3a62134
commit
062bb4f7b2
|
@ -74,16 +74,10 @@ async function updateCharacter(characterData, image = null) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 캐릭터 삭제
|
|
||||||
async function deleteCharacter(id) {
|
|
||||||
return Vue.axios.delete(`/api/admin/characters/${id}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getCharacterList,
|
getCharacterList,
|
||||||
searchCharacters,
|
searchCharacters,
|
||||||
getCharacter,
|
getCharacter,
|
||||||
createCharacter,
|
createCharacter,
|
||||||
updateCharacter,
|
updateCharacter
|
||||||
deleteCharacter
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,7 +251,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getCharacterList, searchCharacters, deleteCharacter as apiDeleteCharacter } from '@/api/character'
|
import { getCharacterList, searchCharacters, updateCharacter } from '@/api/character'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "CharacterList",
|
name: "CharacterList",
|
||||||
|
@ -349,7 +349,12 @@ export default {
|
||||||
this.is_loading = true
|
this.is_loading = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await apiDeleteCharacter(this.selected_character.id);
|
// 삭제 대신 isActive를 false로 설정하여 비활성화
|
||||||
|
const updateData = {
|
||||||
|
id: this.selected_character.id,
|
||||||
|
isActive: false
|
||||||
|
};
|
||||||
|
await updateCharacter(updateData);
|
||||||
this.closeDeleteDialog();
|
this.closeDeleteDialog();
|
||||||
this.notifySuccess('삭제되었습니다.');
|
this.notifySuccess('삭제되었습니다.');
|
||||||
await this.getCharacters();
|
await this.getCharacters();
|
||||||
|
|
Loading…
Reference in New Issue