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