clients/src/models/attachment.ts
2018-05-17 13:28:22 -04:00

22 lines
565 B
TypeScript

import { AttachmentView } from 'jslib/models/view/attachmentView';
export class Attachment {
static template(): Attachment {
const req = new Attachment();
req.fileName = 'photo.jpg';
return req;
}
static toView(req: Attachment, view = new AttachmentView()) {
view.fileName = req.fileName;
return view;
}
fileName: string;
// Use build method instead of ctor so that we can control order of JSON stringify for pretty print
build(o: AttachmentView) {
this.fileName = o.fileName;
}
}