MCPcopy Index your code
hub / github.com/github-tools/github / listProjectCards

Method listProjectCards

lib/Project.js:135–157  ·  view source on GitHub ↗

* Get information about all cards of a project * @see https://developer.github.com/v3/projects/cards/#list-project-cards * @param {Requestable.callback} [cb] - will receive the list of cards * @return {Promise} - the promise for the http request

(cb)

Source from the content-addressed store, hash-verified

133 * @return {Promise} - the promise for the http request
134 */
135 listProjectCards(cb) {
136 return this.listProjectColumns()
137 .then(({data}) => {
138 return Promise.all(data.map((column) => {
139 return this._requestAllPages(`/projects/columns/${column.id}/cards`, null);
140 }));
141 }).then((cardsInColumns) => {
142 const cards = cardsInColumns.reduce((prev, {data}) => {
143 prev.push(...data);
144 return prev;
145 }, []);
146 if (cb) {
147 cb(null, cards);
148 }
149 return cards;
150 }).catch((err) => {
151 if (cb) {
152 cb(err);
153 return;
154 }
155 throw err;
156 });
157 }
158
159 /**
160 * Get information about all cards of a column

Callers 1

project.spec.jsFile · 0.80

Calls 2

listProjectColumnsMethod · 0.95
_requestAllPagesMethod · 0.80

Tested by

no test coverage detected