Last active
April 15, 2017 18:41
-
-
Save Garvice/34bd0d1483becd5c15435d83a28231fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const TASK_NAME_COLUMN_ID: number = 123456789; | |
const DONE_COLUMN_ID: number = 123456789; | |
private extractTodos(rows: Array<any>): Array<Todo> { | |
const todos = new Array<Todo>(); | |
rows.forEach(row => { | |
let todo = new Todo(row.id); | |
row.cells.forEach(cell => { | |
switch (cell.columnId) { | |
case TASK_NAME_COLUMN_ID: | |
todo.name = cell.value; | |
break; | |
case DONE_COLUMN_ID: | |
todo.completed = cell.value; | |
break; | |
} | |
}); | |
todos.push(todo); | |
}); | |
return todos; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment