Compare commits

..

2 Commits

Author SHA1 Message Date
timotiabbauftech
380ede5ca8 Merge branch 'production' of https://git.abbauf.com/Magang-2025/Kasir into production 2025-09-12 11:45:24 +07:00
timotiabbauftech
37ad328c5c [update] fix bug 2025-09-12 11:45:19 +07:00
2 changed files with 14 additions and 10 deletions

View File

@ -97,7 +97,8 @@
class="w-full h-full object-cover"
/>
<button
@click="removeImage(image.id)"
@click.prevent="removeImage(image.id)"
type="button"
:disabled="uploadLoading"
class="absolute -top-2 -right-2 bg-red-500 text-white rounded-full w-6 h-6 flex items-center justify-center text-sm font-bold shadow-lg hover:bg-red-600 transition-colors disabled:bg-gray-400"
>
@ -345,7 +346,7 @@ const uploadFiles = async (files) => {
const removeImage = async (id) => {
try {
await axios.delete(`/api/foto/hapus/${id}`, {
await axios.delete(`http://127.0.0.1:8000/api/foto/hapus/${id}`, {
headers: {
Authorization: `Bearer ${localStorage.getItem("token")}`,
},

View File

@ -1,7 +1,7 @@
<template>
<mainLayout>
<!-- Modal Buat Item - Sekarang menggunakan komponen terpisah -->
<CreateItemModal
<CreateItemModal
:isOpen="openItemModal"
:product="createdProduct"
@close="closeItemModal"
@ -326,12 +326,15 @@ const submitForm = async (addItem) => {
try {
const response = await axios.post('/api/produk', {
...form.value,
id_user: userId.value,
headers: {
Authorization: `Bearer ${localStorage.getItem("token")}`,
},
});
...form.value,
id_user: userId.value,
},
{
headers: {
Authorization: `Bearer ${localStorage.getItem("token")}`,
},
}
);
const createdProductData = response.data.data;
@ -380,7 +383,7 @@ const resetForm = async () => {
harga_per_gram: 0,
harga_jual: 0,
};
try {
try {
await axios.delete(`/api/foto/reset/${userId.value}`, {
headers: {
Authorization: `Bearer ${localStorage.getItem("token")}`,