aboutsummaryrefslogtreecommitdiffstats
path: root/src/models/News.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/models/News.ts')
-rw-r--r--src/models/News.ts33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/models/News.ts b/src/models/News.ts
deleted file mode 100644
index 4fc21f590..000000000
--- a/src/models/News.ts
+++ /dev/null
@@ -1,33 +0,0 @@
1import { ifUndefinedString, ifUndefinedBoolean } from '../jsUtils';
2
3interface INews {
4 id: string;
5 message: string;
6 type: string;
7 sticky: boolean | undefined;
8}
9
10export default class News {
11 id: string = '';
12
13 message: string = '';
14
15 type: string = 'primary';
16
17 sticky: boolean = false;
18
19 constructor(data: INews) {
20 if (!data) {
21 throw new Error('News config not valid');
22 }
23
24 if (!data.id) {
25 throw new Error('News requires Id');
26 }
27
28 this.id = data.id;
29 this.message = ifUndefinedString(data.message, this.message);
30 this.type = ifUndefinedString(data.type, this.type);
31 this.sticky = ifUndefinedBoolean(data.sticky, this.sticky);
32 }
33}