fixing error
This commit is contained in:
parent
d48ec1a1fd
commit
7cd3e54402
@ -563,8 +563,22 @@ const closeItemModal = () => {
|
||||
editedProduct.value = null;
|
||||
};
|
||||
|
||||
const back = () => {
|
||||
router.push("/produk");
|
||||
const back = async () => {
|
||||
loading.value = true;
|
||||
try{
|
||||
console.log(localStorage.getItem("token"));
|
||||
|
||||
await axios.delete('/api/all/foto', {
|
||||
headers: {
|
||||
Authorization: `Bearer ${localStorage.getItem("token")}`,
|
||||
},
|
||||
});
|
||||
router.push('/produk');
|
||||
} catch (e){
|
||||
console.error("Error image ", e);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
|
||||
@ -468,8 +468,23 @@ const submitForm = async (addItem) => {
|
||||
}
|
||||
};
|
||||
|
||||
const back = () => {
|
||||
router.push('/produk');
|
||||
|
||||
const back = async () => {
|
||||
loading.value = true;
|
||||
try{
|
||||
console.log(localStorage.getItem("token"));
|
||||
|
||||
await axios.delete('/api/all/foto', {
|
||||
headers: {
|
||||
Authorization: `Bearer ${localStorage.getItem("token")}`,
|
||||
},
|
||||
});
|
||||
router.push('/produk');
|
||||
} catch (e){
|
||||
console.error("Error image ", e);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const openCreateItemModal = (product) => {
|
||||
|
||||
@ -37,7 +37,7 @@ Route::prefix('api')->group(function () {
|
||||
Route::post('foto', [FotoSementaraController::class, 'upload']);
|
||||
Route::delete('foto/{id}', [FotoSementaraController::class, 'hapus']);
|
||||
Route::get('produk/edit/{id}', [ProdukController::class, 'edit']);
|
||||
Route::delete('foto/all', [FotoSementaraController::class, 'reset']);
|
||||
Route::delete('all/foto', [FotoSementaraController::class, 'reset']);
|
||||
|
||||
// Laporan
|
||||
Route::prefix('laporan')->group(function () {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user