diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a4dfd73..207fa6d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -30,9 +30,41 @@ jobs: - name: Run tests run: go test ./test/... -v -count=1 + build: + name: Build check + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + + - name: Build backend + run: go build ./... + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 24 + cache: npm + cache-dependency-path: app/package-lock.json + + - name: Install frontend dependencies + working-directory: app + run: npm ci + + - name: Build frontend + working-directory: app + run: npm run build + deploy-backend: name: Deploy backend - needs: test + needs: [test, build] if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest @@ -89,7 +121,7 @@ jobs: deploy-frontend: name: Deploy frontend - needs: test + needs: [test, build] if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest @@ -151,4 +183,5 @@ jobs: echo "Reloading Nginx..." sudo -n /usr/bin/systemctl reload nginx - echo "Frontend deployed successfully." \ No newline at end of file + echo "Frontend deployed successfully." + \ No newline at end of file diff --git a/app/src/pages/profile/Profile.tsx b/app/src/pages/profile/Profile.tsx index 993a1f6..236095c 100644 --- a/app/src/pages/profile/Profile.tsx +++ b/app/src/pages/profile/Profile.tsx @@ -200,14 +200,14 @@ export function Profile() { function openProfileEdit() { setProfileForm({ - name: profile.name ?? '', - phone_number: profile.phone_number ?? '', - building: profile.building ?? '', - hostel: profile.hostel ?? '', - department: profile.department ?? '', - house_number: profile.house_number ?? '', - block: profile.block ?? '', - type: profile.type ?? '', + name: profile?.name ?? '', + phone_number: profile?.phone_number ?? '', + building: profile?.building ?? '', + hostel: profile?.hostel ?? '', + department: profile?.department ?? '', + house_number: profile?.house_number ?? '', + block: profile?.block ?? '', + type: profile?.type ?? '', }); setProfileError(null); setIsEditingProfile(true);