|
@@ -122,7 +122,7 @@
|
|
|
...productFormData
|
|
...productFormData
|
|
|
};
|
|
};
|
|
|
products = [...products, newProduct];
|
|
products = [...products, newProduct];
|
|
|
- console.log('Produto criado com sucesso!');
|
|
|
|
|
|
|
+ //console.log('Produto criado com sucesso!');
|
|
|
resetProductForm();
|
|
resetProductForm();
|
|
|
fetchAllItems();
|
|
fetchAllItems();
|
|
|
} else {
|
|
} else {
|
|
@@ -175,7 +175,7 @@
|
|
|
const result = await response.json();
|
|
const result = await response.json();
|
|
|
|
|
|
|
|
if (result.status === 'ok') {
|
|
if (result.status === 'ok') {
|
|
|
- console.log('Produto atualizado com sucesso!');
|
|
|
|
|
|
|
+ //console.log('Produto atualizado com sucesso!');
|
|
|
isAddingProduct = false;
|
|
isAddingProduct = false;
|
|
|
editingProductId = null;
|
|
editingProductId = null;
|
|
|
// Aqui você pode recarregar a lista de produtos, se quiser
|
|
// Aqui você pode recarregar a lista de produtos, se quiser
|
|
@@ -215,7 +215,7 @@
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
if (res.status === 'ok') {
|
|
if (res.status === 'ok') {
|
|
|
categories = [...categories, { name: newCategoryName }];
|
|
categories = [...categories, { name: newCategoryName }];
|
|
|
- console.log('Categoria criada com sucesso');
|
|
|
|
|
|
|
+ //console.log('Categoria criada com sucesso');
|
|
|
newCategoryName = '';
|
|
newCategoryName = '';
|
|
|
isAddingCategory = false;
|
|
isAddingCategory = false;
|
|
|
fetchAllItems();
|
|
fetchAllItems();
|
|
@@ -276,7 +276,7 @@
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
if (res.status === 'ok') {
|
|
if (res.status === 'ok') {
|
|
|
products = products.filter((p) => p.name !== productName);
|
|
products = products.filter((p) => p.name !== productName);
|
|
|
- console.log('Produto deletado com sucesso!');
|
|
|
|
|
|
|
+ //console.log('Produto deletado com sucesso!');
|
|
|
} else {
|
|
} else {
|
|
|
console.error('Erro ao deletar produto:', res.msg);
|
|
console.error('Erro ao deletar produto:', res.msg);
|
|
|
}
|
|
}
|
|
@@ -314,7 +314,7 @@
|
|
|
.then((response) => response.json())
|
|
.then((response) => response.json())
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
if (res.status === 'ok') {
|
|
if (res.status === 'ok') {
|
|
|
- console.log(res);
|
|
|
|
|
|
|
+ //console.log(res);
|
|
|
products = res.data.map((item) => {
|
|
products = res.data.map((item) => {
|
|
|
const category = categories.find((c) => c.id === item.category_id);
|
|
const category = categories.find((c) => c.id === item.category_id);
|
|
|
return {
|
|
return {
|