diff --git a/.gitea/workflows/develop.yml b/.gitea/workflows/develop.yml
index b78640e..e6b93dc 100644
--- a/.gitea/workflows/develop.yml
+++ b/.gitea/workflows/develop.yml
@@ -33,9 +33,11 @@ jobs:
docker build -t robot-market:${{ steps.vars.outputs.sha }} .
- name: Save previous tag for rollback
+ id: backup
run: |
if [ -f /opt/robot-market-front/.env ]; then
cp /opt/robot-market-front/.env /opt/robot-market-front/.env.previous
+ echo "available=true" >> "$GITHUB_OUTPUT"
fi
- name: Point compose at this build
@@ -43,12 +45,14 @@ jobs:
echo "IMAGE_TAG=${{ steps.vars.outputs.sha }}" > /opt/robot-market-front/.env
- name: Deploy via compose
+ id: deploy
run: |
docker compose --env-file /opt/robot-market-front/.env \
-f /opt/robot-market-front/docker-compose.yml \
up -d --force-recreate
- name: Health check (retries for ~30s)
+ id: health
run: |
for i in $(seq 1 15); do
if docker exec robot-market node -e "
@@ -65,8 +69,8 @@ jobs:
echo "Health check failed after 30s"
exit 1
- - name: Roll back to previous version on failed health check
- if: failure()
+ - name: Roll back after deployment or health check failure
+ if: ${{ failure() && steps.backup.outputs.available == 'true' && (steps.deploy.outcome == 'failure' || steps.health.outcome == 'failure') }}
run: |
if [ -f /opt/robot-market-front/.env.previous ]; then
cp /opt/robot-market-front/.env.previous /opt/robot-market-front/.env
@@ -96,4 +100,4 @@ jobs:
echo "Removing old image robot-market:$tag"
docker rmi "robot-market:$tag" 2>/dev/null || true
fi
- done
\ No newline at end of file
+ done
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b1ecb96..3c481c2 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,10 +4,12 @@
-
+
+
-
+
+
@@ -29,61 +31,61 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{
@@ -195,7 +197,15 @@
-
+
+
+
+
+
+
+
+
+
@@ -421,7 +431,15 @@
1788682678051
-
+
+
+ 1789191804591
+
+
+
+ 1789191804591
+
+
@@ -432,10 +450,10 @@
-
-
+
+
\ No newline at end of file
diff --git a/components/CartDrawer.jsx b/components/CartDrawer.jsx
index 9f5c76f..b515294 100644
--- a/components/CartDrawer.jsx
+++ b/components/CartDrawer.jsx
@@ -11,8 +11,7 @@ import {
selectIsDrawerOpen,
closeDrawer,
removeFromCart,
- incrementQty,
- decrementQty,
+ setQuantity,
} from '@/store/cartSlice';
import {useLanguage} from '@/app/context/LanguageContext';
import api from "@/lib/axios";
@@ -77,10 +76,10 @@ export default function CartDrawer() {
{
- if (val > item.qty) dispatch(incrementQty(item.id));
- else if (val < item.qty) dispatch(decrementQty(item.id));
+ if (val !== null) dispatch(setQuantity({id: item.id, qty: val}));
}}
className="w-16"
/>
diff --git a/components/Header.jsx b/components/Header.jsx
index 053c4f9..6df2259 100644
--- a/components/Header.jsx
+++ b/components/Header.jsx
@@ -80,16 +80,15 @@ export default function Header() {
{t.nav.login}
- {/* faz 1 */}
- {/*
+
*/}
+