diff --git a/client/src/app/core/layout/layout.component.html b/client/src/app/core/layout/layout.component.html index 9032139..5d820c9 100644 --- a/client/src/app/core/layout/layout.component.html +++ b/client/src/app/core/layout/layout.component.html @@ -143,11 +143,9 @@ -
-
-
+
+
+
diff --git a/client/src/app/core/services/recipe.service.ts b/client/src/app/core/services/recipe.service.ts index 0f234e1..e75d3d4 100644 --- a/client/src/app/core/services/recipe.service.ts +++ b/client/src/app/core/services/recipe.service.ts @@ -4,16 +4,19 @@ import { BehaviorSubject, Observable, distinctUntilChanged } from 'rxjs'; import { Recipe } from '../models/recipe.model'; import { environment } from 'src/environments/environment'; -interface Pagination { +interface RecipeParams { offset: number; take: number; + search: string; } @Injectable({ providedIn: 'root' }) export class RecipeService { constructor(private _httpClient: HttpClient) {} - getRecipes(paginate: Pagination = { take: 10, offset: 0 }): Observable<{ + getRecipes( + params: RecipeParams = { take: 10, offset: 0, search: '' } + ): Observable<{ recipes: Recipe; hasMore: boolean; }> { @@ -22,10 +25,12 @@ export class RecipeService { hasMore: boolean; }>(environment.api + '/recipes', { params: { - offset: String(paginate.offset), - take: String(paginate.take), + offset: params.offset, + take: params.take, + search: params.search, }, withCredentials: true, + responseType: 'json', }); } } diff --git a/client/src/app/features/dashboard/dashboard.component.html b/client/src/app/features/dashboard/dashboard.component.html index 87ea7de..f8f9c64 100644 --- a/client/src/app/features/dashboard/dashboard.component.html +++ b/client/src/app/features/dashboard/dashboard.component.html @@ -28,11 +28,17 @@ - +
- +