Issues (324)

public/js/projects.js (4 issues)

1
const joinProject = slug => fetch(`/projects/${slug}/join`, {
0 ignored issues
show
The constant joinProject seems to be never used. Consider removing it.
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
The constant putProjectDetails seems to be never used. Consider removing it.
Loading history...
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
The parameter data is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
32
    window.location = `/projects/${slug}/workspace`;
33
});