Commit 141adfb0 authored by Ivanq's avatar Ivanq

Repo: Add getIssues() and translateDate()

parent a44614ec
......@@ -160,4 +160,23 @@ class Repository {
return row;
});
}
getIssues(page) {
return this.zeroDB.query("SELECT issues.*, json.cert_user_id FROM issues, json WHERE issues.json_id = json.json_id LIMIT " + (page * 10) + ", 11")
.then(issues => {
return {
issues: issues.slice(0, 10),
nextPage: issues.length > 10
};
});
}
translateDate(date) {
date = new Date(date);
return (
date.getFullYear() + "-" +
(date.getMonth() >= 9 ? "" : "0") + (date.getMonth() + 1) + "-" +
date.getDate()
);
}
};
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment