+ EndPoint, APIDocument
This commit is contained in:
1 parent
5640acdd81
commit
ce2d0ec1b9
3 files changed
+16
-1
No files matched your search
@@ -0,0 +1,8 @@
|
|||||||
|
import EndPoint from './EndPoint';
|
||||||
|
|
||||||
|
export default class APIDocument extends EndPoint {
|
||||||
|
awards() {
|
||||||
|
let url = '/documents/awards';
|
||||||
|
return this.request.get(url, {cache: true});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
export default class EndPoint{
|
||||||
|
constructor(http){
|
||||||
|
this.request = http;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,14 +4,16 @@
|
|||||||
|
|
||||||
var APINews = require("./news");
|
var APINews = require("./news");
|
||||||
var APIGallery = require("./gallery");
|
var APIGallery = require("./gallery");
|
||||||
|
import APIDocument from './APIDocument';
|
||||||
|
|
||||||
module.exports = function(app) {
|
module.exports = function (app) {
|
||||||
var minute = 1000 * 60;
|
var minute = 1000 * 60;
|
||||||
|
|
||||||
app.factory("api", function ($http) {
|
app.factory("api", function ($http) {
|
||||||
var api = {};
|
var api = {};
|
||||||
api.news = new APINews($http);
|
api.news = new APINews($http);
|
||||||
api.gallery = new APIGallery($http, minute);
|
api.gallery = new APIGallery($http, minute);
|
||||||
|
api.document = new APIDocument($http);
|
||||||
|
|
||||||
return api;
|
return api;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user