-
-
Notifications
You must be signed in to change notification settings - Fork 673
Expand file tree
/
Copy pathrecipe.data.ts
More file actions
47 lines (44 loc) · 1.04 KB
/
Copy pathrecipe.data.ts
File metadata and controls
47 lines (44 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { Comment } from "./comment.type";
import { Recipe } from "./recipe.type";
function createRecipe(recipeData: Partial<Recipe>): Recipe {
return Object.assign(new Recipe(), recipeData);
}
function createComment(commentData: Partial<Comment>): Comment {
return Object.assign(new Comment(), commentData);
}
export const sampleRecipes = [
createRecipe({
id: "1",
title: "Recipe 1",
description: "Desc 1",
comments: [
createComment({
date: new Date("2018-03-21"),
content: "Very tasty!",
nickname: "Anonymous",
}),
createComment({
date: new Date("2018-01-12"),
content: "Not so tasty!",
nickname: "Anonymous again",
}),
],
}),
createRecipe({
id: "2",
title: "Recipe 2",
description: "Desc 2",
comments: [
createComment({
date: new Date(),
content: "Very good, very cheap!",
nickname: "Master of cooking",
}),
],
}),
createRecipe({
id: "3",
title: "Recipe 3",
comments: [],
}),
];