| 1 |
import BaseModel from './base-model'; |
| 2 |
|
| 3 |
export default class Document extends BaseModel { |
| 4 |
id = ''; |
| 5 |
title = ''; |
| 6 |
documentType = ''; |
| 7 |
thumbnailUrl = ''; |
| 8 |
previewUrl = ''; |
| 9 |
|
| 10 |
/** |
| 11 |
* Create a tag from server response |
| 12 |
* |
| 13 |
* @param {Document} document |
| 14 |
*/ |
| 15 |
static createFromResponse( document ) { |
| 16 |
return new Document().init( { |
| 17 |
id: document.id, |
| 18 |
title: document.title, |
| 19 |
documentType: document.doc_type, |
| 20 |
thumbnailUrl: document.thumbnail_url, |
| 21 |
previewUrl: document.preview_url, |
| 22 |
} ); |
| 23 |
} |
| 24 |
} |
| 25 |
|