diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/api/server/ServerApi.js | 14 | ||||
-rw-r--r-- | src/internal-server/app/Controllers/Http/UserController.js | 2 | ||||
-rw-r--r-- | src/models/Order.ts | 33 | ||||
-rw-r--r-- | src/models/User.ts | 22 |
4 files changed, 1 insertions, 70 deletions
diff --git a/src/api/server/ServerApi.js b/src/api/server/ServerApi.js index a55997b9d..b5042525a 100644 --- a/src/api/server/ServerApi.js +++ b/src/api/server/ServerApi.js | |||
@@ -8,7 +8,6 @@ import RecipePreviewModel from '../../models/RecipePreview'; | |||
8 | import RecipeModel from '../../models/Recipe'; | 8 | import RecipeModel from '../../models/Recipe'; |
9 | import NewsModel from '../../models/News'; | 9 | import NewsModel from '../../models/News'; |
10 | import UserModel from '../../models/User'; | 10 | import UserModel from '../../models/User'; |
11 | import OrderModel from '../../models/Order'; | ||
12 | 11 | ||
13 | import { sleep } from '../../helpers/async-helpers'; | 12 | import { sleep } from '../../helpers/async-helpers'; |
14 | 13 | ||
@@ -589,19 +588,6 @@ export default class ServerApi { | |||
589 | .filter(newsItem => newsItem !== null); | 588 | .filter(newsItem => newsItem !== null); |
590 | } | 589 | } |
591 | 590 | ||
592 | _mapOrderModels(orders) { | ||
593 | return orders | ||
594 | .map(orderItem => { | ||
595 | try { | ||
596 | return new OrderModel(orderItem); | ||
597 | } catch (e) { | ||
598 | console.error(e); | ||
599 | return null; | ||
600 | } | ||
601 | }) | ||
602 | .filter(orderItem => orderItem !== null); | ||
603 | } | ||
604 | |||
605 | _getDevRecipes() { | 591 | _getDevRecipes() { |
606 | const recipesDirectory = getDevRecipeDirectory(); | 592 | const recipesDirectory = getDevRecipeDirectory(); |
607 | try { | 593 | try { |
diff --git a/src/internal-server/app/Controllers/Http/UserController.js b/src/internal-server/app/Controllers/Http/UserController.js index a3ad736fa..d8ed9abc5 100644 --- a/src/internal-server/app/Controllers/Http/UserController.js +++ b/src/internal-server/app/Controllers/Http/UserController.js | |||
@@ -85,7 +85,6 @@ class UserController { | |||
85 | return response.send({ | 85 | return response.send({ |
86 | accountType: 'individual', | 86 | accountType: 'individual', |
87 | beta: false, | 87 | beta: false, |
88 | donor: {}, | ||
89 | email: '', | 88 | email: '', |
90 | emailValidated: true, | 89 | emailValidated: true, |
91 | features: {}, | 90 | features: {}, |
@@ -121,7 +120,6 @@ class UserController { | |||
121 | data: { | 120 | data: { |
122 | accountType: 'individual', | 121 | accountType: 'individual', |
123 | beta: false, | 122 | beta: false, |
124 | donor: {}, | ||
125 | email: '', | 123 | email: '', |
126 | emailValidated: true, | 124 | emailValidated: true, |
127 | features: {}, | 125 | features: {}, |
diff --git a/src/models/Order.ts b/src/models/Order.ts deleted file mode 100644 index 546b813a0..000000000 --- a/src/models/Order.ts +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | // TODO: Can this file be deleted? | ||
2 | |||
3 | interface IOrder { | ||
4 | id: string; | ||
5 | subscriptionId: string; | ||
6 | name: string; | ||
7 | invoiceUrl: string; | ||
8 | price: string; | ||
9 | date: string; | ||
10 | } | ||
11 | |||
12 | export default class Order { | ||
13 | id: string = ''; | ||
14 | |||
15 | subscriptionId: string = ''; | ||
16 | |||
17 | name: string = ''; | ||
18 | |||
19 | invoiceUrl: string = ''; | ||
20 | |||
21 | price: string = ''; | ||
22 | |||
23 | date: string = ''; | ||
24 | |||
25 | constructor(data: IOrder) { | ||
26 | this.id = data.id; | ||
27 | this.subscriptionId = data.subscriptionId; | ||
28 | this.name = data.name || this.name; | ||
29 | this.invoiceUrl = data.invoiceUrl || this.invoiceUrl; | ||
30 | this.price = data.price || this.price; | ||
31 | this.date = data.date || this.date; | ||
32 | } | ||
33 | } | ||
diff --git a/src/models/User.ts b/src/models/User.ts index 8c6c2b1c9..771d11955 100644 --- a/src/models/User.ts +++ b/src/models/User.ts | |||
@@ -8,13 +8,8 @@ interface IUser { | |||
8 | organization: string | null; | 8 | organization: string | null; |
9 | accountType: string | null; | 9 | accountType: string | null; |
10 | beta: boolean; | 10 | beta: boolean; |
11 | donor: object; | ||
12 | isDonor: boolean; | ||
13 | isMiner: boolean; | ||
14 | locale: boolean; | 11 | locale: boolean; |
15 | isSubscriptionOwner: boolean; | 12 | isSubscriptionOwner: boolean; |
16 | hasSubscription: boolean; | ||
17 | hadSubscription: boolean; | ||
18 | team: object; | 13 | team: object; |
19 | } | 14 | } |
20 | 15 | ||
@@ -34,24 +29,14 @@ export default class User { | |||
34 | 29 | ||
35 | @observable emailIsConfirmed = true; | 30 | @observable emailIsConfirmed = true; |
36 | 31 | ||
37 | // TODO: Need to delete references to 'subscription' and 'donor' | 32 | // Note: Kept around to be able to handle the response from Franz server |
38 | // better assume it's confirmed to avoid noise | 33 | // better assume it's confirmed to avoid noise |
39 | @observable subscription = {}; | 34 | @observable subscription = {}; |
40 | 35 | ||
41 | @observable isSubscriptionOwner = false; | 36 | @observable isSubscriptionOwner = false; |
42 | 37 | ||
43 | @observable hasSubscription = true; | ||
44 | |||
45 | @observable hadSubscription = false; | ||
46 | |||
47 | @observable beta = false; | 38 | @observable beta = false; |
48 | 39 | ||
49 | @observable donor = {}; | ||
50 | |||
51 | @observable isDonor = false; | ||
52 | |||
53 | @observable isMiner = false; | ||
54 | |||
55 | @observable locale = false; | 40 | @observable locale = false; |
56 | 41 | ||
57 | @observable team = {}; | 42 | @observable team = {}; |
@@ -68,14 +53,9 @@ export default class User { | |||
68 | this.organization = data.organization || this.organization; | 53 | this.organization = data.organization || this.organization; |
69 | this.accountType = data.accountType || this.accountType; | 54 | this.accountType = data.accountType || this.accountType; |
70 | this.beta = data.beta || this.beta; | 55 | this.beta = data.beta || this.beta; |
71 | this.donor = data.donor || this.donor; | ||
72 | this.isDonor = data.isDonor || this.isDonor; | ||
73 | this.isMiner = data.isMiner || this.isMiner; | ||
74 | this.locale = data.locale || this.locale; | 56 | this.locale = data.locale || this.locale; |
75 | 57 | ||
76 | this.isSubscriptionOwner = data.isSubscriptionOwner || this.isSubscriptionOwner; | 58 | this.isSubscriptionOwner = data.isSubscriptionOwner || this.isSubscriptionOwner; |
77 | this.hasSubscription = data.hasSubscription || this.hasSubscription; | ||
78 | this.hadSubscription = data.hadSubscription || this.hadSubscription; | ||
79 | 59 | ||
80 | this.team = data.team || this.team; | 60 | this.team = data.team || this.team; |
81 | } | 61 | } |