documents update
This commit is contained in:
1 parent
7b6559e57d
commit
10008a323a
7 files changed
+65
-25
No files matched your search
@@ -1,8 +1,13 @@
|
||||
import EndPoint from './EndPoint';
|
||||
|
||||
export default class APIDocument extends EndPoint {
|
||||
documents(){
|
||||
let url = '/documents/type/document';
|
||||
return this.request.get(url, {cache: true});
|
||||
}
|
||||
|
||||
awards() {
|
||||
let url = '/documents/awards';
|
||||
let url = '/documents/type/award';
|
||||
return this.request.get(url, {cache: true});
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,12 @@ import template from '../../templates/components/document.html';
|
||||
export default function (app) {
|
||||
app.component('document', {
|
||||
bindings: {
|
||||
document: '='
|
||||
document: '<'
|
||||
},
|
||||
controllerAs: '$',
|
||||
controller: function () {
|
||||
//this.testing = 123;
|
||||
this.previewUrl = this.document.preview.data.medium.url;
|
||||
this.file = this.document.file;
|
||||
},
|
||||
template: template
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import template from '../../templates/components/page-documents.html';
|
||||
import {docs} from '../../models/document';
|
||||
|
||||
export default function (app) {
|
||||
app.component('pageDocuments', {
|
||||
@@ -7,7 +6,10 @@ export default function (app) {
|
||||
controller: function (api) {
|
||||
this.pageClass = 'page-documents';
|
||||
|
||||
this.documents = docs;
|
||||
api.document.documents()
|
||||
.success(data => {
|
||||
this.documents = data;
|
||||
});
|
||||
|
||||
api.document.awards()
|
||||
.success(data => {
|
||||
|
||||
Reference in new issue
Block a user