Handling missing card titles.
This commit is contained in:
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
0
config/default.js
Normal file → Executable file
0
config/default.js
Normal file → Executable file
0
package-lock.json
generated
Normal file → Executable file
0
package-lock.json
generated
Normal file → Executable file
0
package.json
Normal file → Executable file
0
package.json
Normal file → Executable file
8
src/app.js
Normal file → Executable file
8
src/app.js
Normal file → Executable file
@@ -31,6 +31,12 @@ async function getWekanActorNames() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const actorNames = wekanBoardRes.body.map((card) => {
|
const actorNames = wekanBoardRes.body.map((card) => {
|
||||||
|
if (!card.title) {
|
||||||
|
console.warn('Missing card title', card);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const name = card.title.split(/\s+/).slice(0, 2).join(' ');
|
const name = card.title.split(/\s+/).slice(0, 2).join(' ');
|
||||||
|
|
||||||
if (name.includes('.')) {
|
if (name.includes('.')) {
|
||||||
@@ -41,7 +47,7 @@ async function getWekanActorNames() {
|
|||||||
return name;
|
return name;
|
||||||
;});
|
;});
|
||||||
|
|
||||||
return actorNames;
|
return actorNames.filter(Boolean);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
|
|||||||
Reference in New Issue
Block a user