Commit f6a236c85ed186086f95f436697e69f7e7abbadf
1 parent
70794183
Exists in
master
and in
1 other branch
removed unused file
Showing
1 changed file
with
0 additions
and
39 deletions
Show diff stats
src/lib/ng-noosfero-api/http/article_facility_service.ts
| ... | ... | @@ -1,39 +0,0 @@ |
| 1 | - | |
| 2 | - | |
| 3 | -export class ArticleFactilityService { | |
| 4 | - | |
| 5 | - public static ARTICLES_RESOURCE_NAME = "articles"; | |
| 6 | - | |
| 7 | - resourceBase: restangular.IElement = null; | |
| 8 | - | |
| 9 | - constructor( | |
| 10 | - protected restangularService: restangular.IService, | |
| 11 | - protected profile: noosfero.Profile) { | |
| 12 | - if (!profile) { | |
| 13 | - throw new Error("Could not instantiate ArticleOwner Service! Profile is missing!"); | |
| 14 | - } | |
| 15 | - } | |
| 16 | - | |
| 17 | - | |
| 18 | - getArticles(params?: any, headers?: any): restangular.ICollectionPromise<noosfero.Article> { | |
| 19 | - return this.profile.getList<noosfero.Article>(ArticleFactilityService.ARTICLES_RESOURCE_NAME, params, headers); | |
| 20 | - } | |
| 21 | - | |
| 22 | - getArticle(id: number, params?: any, headers?: any): restangular.IPromise<noosfero.Article> { | |
| 23 | - return this.profile.one(ArticleFactilityService.ARTICLES_RESOURCE_NAME, id).get(params, headers); | |
| 24 | - } | |
| 25 | - | |
| 26 | - removeArticle(article: noosfero.Article, params?: any, headers?: any): restangular.IPromise<noosfero.Article> { | |
| 27 | - let element: restangular.IElement = this.restangularService.restangularizeElement(this.profile, article, ArticleFactilityService.ARTICLES_RESOURCE_NAME); | |
| 28 | - return element.remove(params, headers); | |
| 29 | - } | |
| 30 | - | |
| 31 | - createArticle(article: noosfero.Article, params?: any, headers?: any): restangular.IPromise<noosfero.Article> { | |
| 32 | - return this.profile.post<noosfero.Article>(ArticleFactilityService.ARTICLES_RESOURCE_NAME, article, params, headers); | |
| 33 | - } | |
| 34 | - | |
| 35 | - updateArticle(article: noosfero.Article, params?: any, headers?: any): restangular.IPromise<noosfero.Article> { | |
| 36 | - let element: restangular.IElement = this.restangularService.restangularizeElement(this.profile, article, ArticleFactilityService.ARTICLES_RESOURCE_NAME); | |
| 37 | - return element.put(params, headers); | |
| 38 | - } | |
| 39 | -} | |
| 40 | 0 | \ No newline at end of file |