aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/todo/todo-service/todo.service.ts
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-03-11 19:52:29 +0800
committerGitHub <noreply@github.com>2019-03-11 19:52:29 +0800
commit8caef17dd3e455de27f44d13751c27ee4dfe2e1e (patch)
tree5b485ad438c9be9c180d425453588ff1c575a42d /Timeline/ClientApp/src/app/todo/todo-service/todo.service.ts
parent17d90077b289c6b2203a34de727dd77c1985f146 (diff)
parentb26342764046d188d223aa494c3bbbf76deb4927 (diff)
downloadtimeline-8caef17dd3e455de27f44d13751c27ee4dfe2e1e.tar.gz
timeline-8caef17dd3e455de27f44d13751c27ee4dfe2e1e.tar.bz2
timeline-8caef17dd3e455de27f44d13751c27ee4dfe2e1e.zip
Merge pull request #11 from crupest/7-user-route
Use named route in user dialog.
Diffstat (limited to 'Timeline/ClientApp/src/app/todo/todo-service/todo.service.ts')
-rw-r--r--Timeline/ClientApp/src/app/todo/todo-service/todo.service.ts14
1 files changed, 2 insertions, 12 deletions
diff --git a/Timeline/ClientApp/src/app/todo/todo-service/todo.service.ts b/Timeline/ClientApp/src/app/todo/todo-service/todo.service.ts
index ed1f2cbe..df63636d 100644
--- a/Timeline/ClientApp/src/app/todo/todo-service/todo.service.ts
+++ b/Timeline/ClientApp/src/app/todo/todo-service/todo.service.ts
@@ -3,29 +3,19 @@ import { HttpClient } from '@angular/common/http';
import { Observable, from } from 'rxjs';
import { switchMap, map, filter } from 'rxjs/operators';
+import { IssueResponse, githubBaseUrl } from './http-entities';
import { TodoItem } from '../todo-item';
-export interface IssueResponseItem {
- number: number;
- title: string;
- state: string;
- html_url: string;
- pull_request?: any;
-}
-
-export type IssueResponse = IssueResponseItem[];
@Injectable({
providedIn: 'root'
})
export class TodoService {
- readonly baseUrl = 'https://api.github.com/repos/crupest/Timeline';
-
constructor(private client: HttpClient) { }
getWorkItemList(): Observable<TodoItem> {
- return this.client.get<IssueResponse>(`${this.baseUrl}/issues`, {
+ return this.client.get<IssueResponse>(`${githubBaseUrl}/issues`, {
params: {
state: 'all'
}