diff --git a/fastify/assets/srcs/controllers/private/browsing/index.ts b/fastify/assets/srcs/controllers/private/browsing/index.ts index 97b2f32..962baa8 100644 --- a/fastify/assets/srcs/controllers/private/browsing/index.ts +++ b/fastify/assets/srcs/controllers/private/browsing/index.ts @@ -17,7 +17,7 @@ export const browseUsersHandler = async (request: FastifyRequest, reply: Fastify offset, limit } = request.params as { minAge: number, maxAge: number, minFame: number, maxFame: number, tags: string, lat: number, lng: number, radius: number, sortBy: string, offset: number, limit: number }; - + console.log('Browsing with params:', request.params); if (!request.user?.id) throw new UnauthorizedError(); const tagsArray = tags ? tags.split(',') : []; @@ -36,6 +36,7 @@ export const browseUsersHandler = async (request: FastifyRequest, reply: Fastify requestFilters, (sortBy ? sortBy as BrowsingSort : undefined) ); + console.log(`Found ${users.length} users for browsing`); return reply.status(200).send({ users }); } catch (error) { if (error instanceof AppError) { diff --git a/fastify/assets/srcs/routes/private/user/me/completeProfile.ts b/fastify/assets/srcs/routes/private/user/me/completeProfile.ts index cfab1b8..ab32329 100644 --- a/fastify/assets/srcs/routes/private/user/me/completeProfile.ts +++ b/fastify/assets/srcs/routes/private/user/me/completeProfile.ts @@ -32,7 +32,7 @@ const completeProfileRoutes = async (fastify: FastifyInstance) => { firstName: { type: 'string', minLength: 1, maxLength: 50, pattern: '[a-zA-Z-\' ]' }, lastName: { type: 'string', minLength: 1, maxLength: 50, pattern: '[a-zA-Z-\' ]' }, bio: { type: 'string', minLength: 50, maxLength: 500 }, - tags: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 30, pattern: '[a-zA-Z_]' }, minItems: 3 }, + tags: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 30 }, minItems: 3 }, gender: { type: 'string', enum: ['men', 'women'] }, orientation: { type: 'string', enum: ['heterosexual', 'homosexual', 'bisexual', 'other'] }, bornAt: { type: 'string', format: 'date-time' }, diff --git a/fastify/assets/srcs/routes/private/user/me/profile.ts b/fastify/assets/srcs/routes/private/user/me/profile.ts index 75fee9b..66bdd8d 100644 --- a/fastify/assets/srcs/routes/private/user/me/profile.ts +++ b/fastify/assets/srcs/routes/private/user/me/profile.ts @@ -11,7 +11,7 @@ const profileRoutes = async (fastify: FastifyInstance) => { lastName: { type: 'string', minLength: 1, maxLength: 50, pattern: '[a-zA-Z-\' ]' }, email: { type: 'string', format: 'email' }, bio: { type: 'string', minLength: 50, maxLength: 500 }, - tags: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 30, pattern: '[a-zA-Z_]' }, minItems: 3 }, + tags: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 30 }, minItems: 3 }, gender: { type: 'string', enum: ['men', 'women'] }, orientation: { type: 'string', enum: ['heterosexual', 'homosexual', 'bisexual', 'other'] }, bornAt: { type: 'string', format: 'date-time' }, diff --git a/fastify/assets/srcs/services/BrowsingService.ts b/fastify/assets/srcs/services/BrowsingService.ts index f918a3a..2f09263 100644 --- a/fastify/assets/srcs/services/BrowsingService.ts +++ b/fastify/assets/srcs/services/BrowsingService.ts @@ -117,6 +117,7 @@ BETWEEN ${filters.age.min} AND ${filters.age.max} `, parameters ); + return result.rows.map((row: { id: number; first_name: string; diff --git a/fastify/assets/test/integration/fixtures/auth.fixtures.ts b/fastify/assets/test/integration/fixtures/auth.fixtures.ts index 41e76e4..a9999d8 100644 --- a/fastify/assets/test/integration/fixtures/auth.fixtures.ts +++ b/fastify/assets/test/integration/fixtures/auth.fixtures.ts @@ -30,7 +30,6 @@ export const signUpAndGetToken = async (app: FastifyInstance, userData: UserData if (signUpResponse.statusCode !== 201) { - console.log('Sign up response:', signUpResponse); throw new Error(`Failed to sign up user: ${signUpResponse.body}, code: ${signUpResponse.statusCode}`); } diff --git a/nextjs/matcha/src/app/(logged)/browsing/page.tsx b/nextjs/matcha/src/app/(logged)/browsing/page.tsx index 50fc3d4..5f1e4e9 100644 --- a/nextjs/matcha/src/app/(logged)/browsing/page.tsx +++ b/nextjs/matcha/src/app/(logged)/browsing/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState, useMemo, useCallback, useEffect } from "react"; +import { useState, useMemo, useCallback, useEffect, use } from "react"; import { useRouter, useSearchParams } from "next/navigation"; import Typography from "@/components/common/Typography"; import Stack from "@/components/common/Stack"; @@ -83,7 +83,6 @@ export default function BrowsingPage() { const { likeUser, isLiking } = useLikeUser(); const { passUser, isPassing } = usePassUser(); - // When search params change, update filters useEffect(() => { if (searchCriteria) { setFilters(searchCriteria); diff --git a/nextjs/matcha/src/components/browsing/ProfileCard.tsx b/nextjs/matcha/src/components/browsing/ProfileCard.tsx index 7ea3189..149e246 100644 --- a/nextjs/matcha/src/components/browsing/ProfileCard.tsx +++ b/nextjs/matcha/src/components/browsing/ProfileCard.tsx @@ -24,6 +24,8 @@ export default function ProfileCard({ {/* Image */}
{name} { return response; } catch (error) { console.error("Failed to update default location:", error); + throw error; } }; diff --git a/nextjs/matcha/src/lib/api/browsing.ts b/nextjs/matcha/src/lib/api/browsing.ts index c86bdb2..efe90f8 100644 --- a/nextjs/matcha/src/lib/api/browsing.ts +++ b/nextjs/matcha/src/lib/api/browsing.ts @@ -61,8 +61,6 @@ export const browsingApi = { }; */ - console.log("donc les tags sont:", userProfile?.tags); - const { ageMin = 18, ageMax = 100, diff --git a/nextjs/matcha/src/lib/api/userProfile.ts b/nextjs/matcha/src/lib/api/userProfile.ts index 02ac7be..9b3a4dd 100644 --- a/nextjs/matcha/src/lib/api/userProfile.ts +++ b/nextjs/matcha/src/lib/api/userProfile.ts @@ -25,7 +25,6 @@ export const userProfileApi = { */ getUserProfile: async ({ userId }: GetUserProfileRequest): Promise => { const response = await axios.get(`/api/private/user/view/${userId}`); - console.log('getUserProfile response:', response.data); return response.data; }, diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 65264b4..10ce5d1 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -20,7 +20,7 @@ http { } server { - client_max_body_size 2M; + client_max_body_size 50M; listen 443 ssl; listen [::]:443 ssl; http2 on;