update recipe now can select recipe file
This commit is contained in:
parent
b25c836f0c
commit
b5cb469a30
11 changed files with 209 additions and 236173 deletions
|
|
@ -5,6 +5,7 @@ import { Recipe, Recipe01 } from '../models/recipe.model';
|
|||
import { environment } from 'src/environments/environment';
|
||||
|
||||
interface RecipeParams {
|
||||
version: string;
|
||||
offset: number;
|
||||
take: number;
|
||||
search: string;
|
||||
|
|
@ -15,12 +16,19 @@ export class RecipeService {
|
|||
constructor(private _httpClient: HttpClient) {}
|
||||
|
||||
getRecipes(
|
||||
params: RecipeParams = { take: 10, offset: 0, search: '' }
|
||||
params: RecipeParams = {
|
||||
take: 10,
|
||||
offset: 0,
|
||||
search: '',
|
||||
version: 'coffeethai02_580.json',
|
||||
}
|
||||
): Observable<{
|
||||
fileName: string;
|
||||
recipes: Recipe;
|
||||
hasMore: boolean;
|
||||
}> {
|
||||
return this._httpClient.get<{
|
||||
fileName: string;
|
||||
recipes: Recipe;
|
||||
hasMore: boolean;
|
||||
}>(environment.api + '/recipes', {
|
||||
|
|
@ -28,6 +36,7 @@ export class RecipeService {
|
|||
offset: params.offset,
|
||||
take: params.take,
|
||||
search: params.search,
|
||||
version: params.version,
|
||||
},
|
||||
withCredentials: true,
|
||||
responseType: 'json',
|
||||
|
|
@ -40,4 +49,11 @@ export class RecipeService {
|
|||
responseType: 'json',
|
||||
});
|
||||
}
|
||||
|
||||
getRecipeVersions(): Observable<string[]> {
|
||||
return this._httpClient.get<string[]>(
|
||||
environment.api + '/recipes/versions',
|
||||
{ withCredentials: true, responseType: 'json' }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue