CenterForDigitalHumanities / CenterForDigitalHumanities/TPEN-NL

getUserProjects(id) is a mess

Open
#203 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

This is called on page load as `getUserProjects(007)` with a hard-coded octal as an argument.

The definition is `let getUserProjects = async function (lookupID) {` but lookupID is never used.

`let projectName = "";` is set and then never heard from again.

`return projectList = await fetch(url, {` seems to assign the fetch to an unused variable just to force the await before the return. Also, the `url` variable is always and just the String "projects" so it might not be important to pull out.

4 way elif could probably be a switch.

Errors are caught but not reported to the UI unless they are successful errors with 40x codes.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.