aboutsummaryrefslogtreecommitdiff
path: root/src/fields/ImageField.ts
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-03-09 16:06:18 -0500
committerab <abdullah_ahmed@brown.edu>2019-03-09 16:06:18 -0500
commita2b90031fe06701b0ecc7c6fa3b48c933e4d37b8 (patch)
tree541052a97652ad25b0829685f205ec35d3976743 /src/fields/ImageField.ts
parentb72ff1323bc76dc244ebe50893aa78064fd836c7 (diff)
parent09928503be98d605052fba65dcd2f91f9b056f23 (diff)
fix
Diffstat (limited to 'src/fields/ImageField.ts')
-rw-r--r--src/fields/ImageField.ts15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/fields/ImageField.ts b/src/fields/ImageField.ts
index d82260f54..b2226d55a 100644
--- a/src/fields/ImageField.ts
+++ b/src/fields/ImageField.ts
@@ -1,9 +1,11 @@
import { BasicField } from "./BasicField";
-import { Field } from "./Field";
+import { Field, FieldId } from "./Field";
+import { Types } from "../server/Message";
+import { ObjectID } from "bson";
export class ImageField extends BasicField<URL> {
- constructor(data: URL | undefined = undefined) {
- super(data == undefined ? new URL("http://cs.brown.edu/~bcz/bob_fettucine.jpg") : data);
+ constructor(data: URL | undefined = undefined, id?: FieldId, save: boolean = true) {
+ super(data == undefined ? new URL("http://cs.brown.edu/~bcz/bob_fettucine.jpg") : data, save, id);
}
toString(): string {
@@ -18,4 +20,11 @@ export class ImageField extends BasicField<URL> {
return new ImageField(this.Data);
}
+ ToJson(): { type: Types, data: URL, _id: string } {
+ return {
+ type: Types.Image,
+ data: this.Data,
+ _id: this.Id
+ }
+ }
} \ No newline at end of file