Skip to content

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

Merged
merged 3 commits into from
Jul 18, 2025
Merged

Conversation

zigzagdev
Copy link
Owner

No description provided.

@zigzagdev zigzagdev requested a review from Copilot July 18, 2025 02:56
Copy link

@Copilot Copilot AI left a 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"
Copy link
Preview

Copilot AI Jul 18, 2025

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.

Suggested change
- "6673:5174"
- "6673:5173"

Copilot uses AI. Check for mistakes.

}

setErrorMsg(messages.error.login.default);
console.log(response);
Copy link
Preview

Copilot AI Jul 18, 2025

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.

Suggested change
console.log(response);
// Handle response if needed

Copilot uses AI. Check for mistakes.

return new Promise((resolve) => {
setTimeout(() => {
console.log('📦 Mock register user:', data);
Copy link
Preview

Copilot AI Jul 18, 2025

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"
Copy link
Preview

Copilot AI Jul 18, 2025

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.

Suggested change
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",
Copy link
Preview

Copilot AI Jul 18, 2025

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.

Suggested change
"postcss": "^8.5.3",
"postcss": "^8.5.6",

Copilot uses AI. Check for mistakes.

@zigzagdev zigzagdev self-assigned this Jul 18, 2025
@zigzagdev zigzagdev merged commit 1677f0d into main Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant