-
Notifications
You must be signed in to change notification settings - Fork 0
Chore: replace the mock into API #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR performs a significant refactoring to replace API integration with mock implementations for development purposes. The changes simplify the authentication and registration flows by removing external API dependencies and using mock data instead.
- Replaces real API calls with mock implementations for login and registration
- Simplifies form validation schemas by removing optional fields
- Updates configuration files for local development setup
Reviewed Changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
src/lib/register.ts | Replaces API registration with mock implementation |
src/lib/login.ts | Updates login endpoint from users to auth |
src/hooks/validation/register.ts | Simplifies registration schema, removes optional fields |
src/features/dashboard/DashboardContainer.tsx | Removes user profile fetching, simplifies feed loading |
src/features/auth/login/LoginContainer.tsx | Removes navigation logic, simplifies to console logging |
src/components/forms/registration-form/RegistrationForm.tsx | Removes complex form fields, simplifies to basic registration |
vite.config.ts | Changes strictPort to true for development |
docker-compose.yml | Updates port mapping configuration |
@@ -7,7 +7,7 @@ services: | |||
dockerfile: Dockerfile | |||
container_name: vite-react-app | |||
ports: | |||
- "6673:5173" | |||
- "6673:5174" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Port mapping inconsistency: The container is mapped to port 5174, but vite.config.ts specifies port 5173. This will cause the application to be unreachable.
- "6673:5174" | |
- "6673:5173" |
Copilot uses AI. Check for mistakes.
} | ||
|
||
setErrorMsg(messages.error.login.default); | ||
console.log(response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Console.log statement should be removed from production code. Consider using proper logging or removing this debug statement.
console.log(response); | |
// Handle response if needed |
Copilot uses AI. Check for mistakes.
return new Promise((resolve) => { | ||
setTimeout(() => { | ||
console.log('📦 Mock register user:', data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Console.log statement should be removed from production code. Consider using proper logging or removing this debug statement.
Copilot uses AI. Check for mistakes.
@@ -113,69 +74,16 @@ const RegistrationForm: React.FC = () => { | |||
<PasswordInput | |||
label="Password" | |||
{...register('password')} | |||
placeholder="Minimum 8 characters" | |||
placeholder="Minimum 6 characters" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Password placeholder states 'Minimum 6 characters' but the validation schema requires minimum 8 characters. This inconsistency will confuse users.
placeholder="Minimum 6 characters" | |
placeholder="Minimum 8 characters" |
Copilot uses AI. Check for mistakes.
@@ -36,7 +36,7 @@ | |||
"globals": "^15.15.0", | |||
"husky": "^9.1.7", | |||
"lint-staged": "^15.5.1", | |||
"postcss": "^8.5.6", | |||
"postcss": "^8.5.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PostCSS version was downgraded from ^8.5.6 to ^8.5.3. This change appears unrelated to the mock implementation purpose and may introduce compatibility issues.
"postcss": "^8.5.3", | |
"postcss": "^8.5.6", |
Copilot uses AI. Check for mistakes.
No description provided.