CraftCamp /
official-website
| 1 | const joinProject = slug => fetch(`/projects/${slug}/join`, { |
||
|
0 ignored issues
–
show
Unused Code
introduced
by
Loading history...
|
|||
| 2 | method: 'POST', |
||
| 3 | headers: { |
||
| 4 | 'Content-Type': 'application/json' |
||
| 5 | }, |
||
| 6 | credentials: 'include' |
||
| 7 | }).then(response => response.json()) |
||
| 8 | .then(membership => { |
||
| 9 | var list = document.querySelector("#project-members > section"); |
||
| 10 | |||
| 11 | var element = document.createElement('div'); |
||
| 12 | element.classList.add('member'); |
||
| 13 | element.innerText = membership.user.username; |
||
| 14 | list.appendChild(element); |
||
| 15 | |||
| 16 | document.querySelector('#project-members > footer').removeChild(document.querySelector('#join-button')); |
||
| 17 | }); |
||
| 18 | |||
| 19 | const putProjectDetails = slug => fetch(`/projects/${slug}/details`, { |
||
|
0 ignored issues
–
show
|
|||
| 20 | method: 'PUT', |
||
| 21 | headers: { |
||
| 22 | 'Content-Type': 'application/json' |
||
| 23 | }, |
||
| 24 | body: JSON.stringify({ |
||
| 25 | need_description: editors.needDescription.getData(), |
||
|
0 ignored issues
–
show
The variable
editors seems to be never declared. If this is a global, consider adding a /** global: editors */ comment.
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed. To learn more about declaring variables in Javascript, see the MDN. Loading history...
|
|||
| 26 | target_description: editors.targetDescription.getData(), |
||
| 27 | goal_description: editors.goalDescription.getData() |
||
| 28 | }), |
||
| 29 | credentials: 'include' |
||
| 30 | }).then(response => response.json()) |
||
| 31 | .then(data => { |
||
|
0 ignored issues
–
show
|
|||
| 32 | window.location = `/projects/${slug}/workspace`; |
||
| 33 | }); |