From cbb8dd64cb08597a1bcb84fa8b536474d0e1d9b5 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 12 Feb 2026 16:01:02 +0000
Subject: [PATCH 1/3] Initial plan
From 2a3e30165e3ec79c7b96a327c2d7038deef417eb Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 12 Feb 2026 16:06:31 +0000
Subject: [PATCH 2/3] Fix: Pass userId to submissions API endpoint
Updated MySubmissions component to accept userId prop and include it in API calls. This fixes the missing userId parameter issue in the GET /api/submissions endpoint.
Co-authored-by: ghostleek <44336310+ghostleek@users.noreply.github.com>
---
package-lock.json | 12 ++++++++++++
src/components/UserDashboard.tsx | 2 +-
src/components/dashboard/MySubmissions.tsx | 11 +++++++----
3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 03f179a..b9cd7c3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -83,6 +83,7 @@
"integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@babel/code-frame": "^7.29.0",
"@babel/generator": "^7.29.0",
@@ -2953,6 +2954,7 @@
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.1.0.tgz",
"integrity": "sha512-t7frlewr6+cbx+9Ohpl0NOTKXZNV9xHRmNOvql47BFJKcEG1CxtxlPEEe+gR9uhVWM4DwhnvTF110mIL4yP9RA==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"undici-types": "~7.16.0"
}
@@ -2985,6 +2987,7 @@
"integrity": "sha512-WPigyYuGhgZ/cTPRXB2EwUw+XvsRA3GqHlsP4qteqrnnjDrApbS7MxcGr/hke5iUoeB7E/gQtrs9I37zAJ0Vjw==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"csstype": "^3.2.2"
}
@@ -4854,6 +4857,7 @@
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
"dev": true,
"license": "MIT",
+ "peer": true,
"bin": {
"acorn": "bin/acorn"
},
@@ -5220,6 +5224,7 @@
}
],
"license": "MIT",
+ "peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.9.0",
"caniuse-lite": "^1.0.30001759",
@@ -6590,6 +6595,7 @@
"integrity": "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==",
"hasInstallScript": true,
"license": "MIT",
+ "peer": true,
"bin": {
"esbuild": "bin/esbuild"
},
@@ -8489,6 +8495,7 @@
}
],
"license": "MIT",
+ "peer": true,
"dependencies": {
"nanoid": "^3.3.11",
"picocolors": "^1.1.1",
@@ -8680,6 +8687,7 @@
"resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz",
"integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==",
"license": "MIT",
+ "peer": true,
"engines": {
"node": ">=0.10.0"
}
@@ -8689,6 +8697,7 @@
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz",
"integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==",
"license": "MIT",
+ "peer": true,
"dependencies": {
"scheduler": "^0.27.0"
},
@@ -8872,6 +8881,7 @@
"integrity": "sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"@types/estree": "1.0.8"
},
@@ -9692,6 +9702,7 @@
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"license": "Apache-2.0",
+ "peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@@ -10345,6 +10356,7 @@
"integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==",
"dev": true,
"license": "MIT",
+ "peer": true,
"dependencies": {
"esbuild": "^0.27.0",
"fdir": "^6.5.0",
diff --git a/src/components/UserDashboard.tsx b/src/components/UserDashboard.tsx
index c722e51..d0b4c24 100644
--- a/src/components/UserDashboard.tsx
+++ b/src/components/UserDashboard.tsx
@@ -357,7 +357,7 @@ export function UserDashboard() {
)}
{activeTab === 'submissions' && (
-
+
)}
{/* Submit App Modal */}
diff --git a/src/components/dashboard/MySubmissions.tsx b/src/components/dashboard/MySubmissions.tsx
index 9e0e7e9..9d0fa30 100644
--- a/src/components/dashboard/MySubmissions.tsx
+++ b/src/components/dashboard/MySubmissions.tsx
@@ -15,20 +15,23 @@ interface Submission {
interface MySubmissionsProps {
t: (light: string, dark: string) => string;
onSubmitApp: () => void;
+ userId: string;
}
-export function MySubmissions({ t, onSubmitApp }: MySubmissionsProps) {
+export function MySubmissions({ t, onSubmitApp, userId }: MySubmissionsProps) {
const [submissions, setSubmissions] = useState([]);
const [loading, setLoading] = useState(false);
useEffect(() => {
- loadSubmissions();
- }, []);
+ if (userId) {
+ loadSubmissions();
+ }
+ }, [userId]);
const loadSubmissions = async () => {
try {
setLoading(true);
- const response = await fetch('/api/submissions');
+ const response = await fetch(`/api/submissions?userId=${encodeURIComponent(userId)}`);
if (response.ok) {
const data = await response.json();
setSubmissions(data.submissions);
From ea1935482bc3bd7e1451df11a2af6376aa2e3ea9 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 12 Feb 2026 16:07:17 +0000
Subject: [PATCH 3/3] Fix: Use useCallback for loadSubmissions to satisfy
exhaustive-deps
Wrapped loadSubmissions in useCallback to properly handle React hook dependencies and prevent stale closures.
Co-authored-by: ghostleek <44336310+ghostleek@users.noreply.github.com>
---
src/components/dashboard/MySubmissions.tsx | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/components/dashboard/MySubmissions.tsx b/src/components/dashboard/MySubmissions.tsx
index 9d0fa30..b1675d2 100644
--- a/src/components/dashboard/MySubmissions.tsx
+++ b/src/components/dashboard/MySubmissions.tsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react';
+import { useState, useEffect, useCallback } from 'react';
interface Submission {
id: string;
@@ -22,13 +22,7 @@ export function MySubmissions({ t, onSubmitApp, userId }: MySubmissionsProps) {
const [submissions, setSubmissions] = useState([]);
const [loading, setLoading] = useState(false);
- useEffect(() => {
- if (userId) {
- loadSubmissions();
- }
- }, [userId]);
-
- const loadSubmissions = async () => {
+ const loadSubmissions = useCallback(async () => {
try {
setLoading(true);
const response = await fetch(`/api/submissions?userId=${encodeURIComponent(userId)}`);
@@ -41,7 +35,13 @@ export function MySubmissions({ t, onSubmitApp, userId }: MySubmissionsProps) {
} finally {
setLoading(false);
}
- };
+ }, [userId]);
+
+ useEffect(() => {
+ if (userId) {
+ loadSubmissions();
+ }
+ }, [userId, loadSubmissions]);
const getStatusBadge = (status: string) => {
const styles = {