aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/todo-list.service.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-02-18 19:26:12 +0800
committercrupest <crupest@outlook.com>2019-02-18 19:26:12 +0800
commita8d850e05fba39a46f54d3c2827e8b93bcbb129b (patch)
tree1dc17f612e5a1cdbd5cec6bdf38ec231934d119d /Timeline/ClientApp/src/app/todo-list.service.ts
parent5194cfc3fc9bbe6d2e03fdceb4ed58a8b7c0f6a9 (diff)
downloadtimeline-a8d850e05fba39a46f54d3c2827e8b93bcbb129b.tar.gz
timeline-a8d850e05fba39a46f54d3c2827e8b93bcbb129b.tar.bz2
timeline-a8d850e05fba39a46f54d3c2827e8b93bcbb129b.zip
Beautify the todo page.
Diffstat (limited to 'Timeline/ClientApp/src/app/todo-list.service.ts')
-rw-r--r--Timeline/ClientApp/src/app/todo-list.service.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/Timeline/ClientApp/src/app/todo-list.service.ts b/Timeline/ClientApp/src/app/todo-list.service.ts
index e92a11c9..b1bc5ff3 100644
--- a/Timeline/ClientApp/src/app/todo-list.service.ts
+++ b/Timeline/ClientApp/src/app/todo-list.service.ts
@@ -17,6 +17,11 @@ interface WorkItemResult {
fields: { [name: string]: any };
}
+export interface WorkItem {
+ id: number;
+ title: string;
+}
+
@Injectable({
providedIn: 'root'
})
@@ -37,13 +42,13 @@ export class TodoListService {
});
}
- getWorkItemList(): Observable<string[]> {
+ getWorkItemList(): Observable<WorkItem[]> {
return this.client.post<WiqlResult>(`https://dev.azure.com/${this.organization}/${this.project}/_apis/wit/wiql?api-version=5.0`, {
query: 'SELECT [System.Id] FROM workitems WHERE [System.TeamProject] = @project'
}, { headers: this.headers }).pipe(
switchMap(result => result.workItems),
concatMap(result => this.client.get<WorkItemResult>(result.url, {headers: this.headers})),
- map(result => <string>(result.fields[this.fieldId])),
+ map(result => <WorkItem>{ id: result.id, title: result.fields[this.fieldId] }),
toArray()
);
}