mirror of
https://github.com/System-End/site.git
synced 2026-04-19 23:22:49 +00:00
Did some typing in the file
This commit is contained in:
parent
b6149defb8
commit
92c622d7e2
2 changed files with 24 additions and 24 deletions
|
|
@ -85,6 +85,6 @@ const addVote = async (projectId, points, userID, type) => {
|
|||
Voter: [userID],
|
||||
Showcase: [projectId],
|
||||
Type: type
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
|
@ -239,24 +239,26 @@ const My = () => {
|
|||
setStatus('loading')
|
||||
|
||||
try {
|
||||
const response = await fetch(
|
||||
`/api/arcade/showcase/projects/${openProjectId}`,
|
||||
{
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`
|
||||
if (openProjectId){
|
||||
const response = await fetch(
|
||||
`/api/arcade/showcase/projects/${openProjectId}`,
|
||||
{
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
const data = await response.json()
|
||||
|
||||
if (data.error) {
|
||||
setStatus('error')
|
||||
setError(data.error)
|
||||
} else {
|
||||
setOpenProject(data.project)
|
||||
setStatus('success')
|
||||
}
|
||||
)
|
||||
|
||||
const data = await response.json()
|
||||
|
||||
if (data.error) {
|
||||
setStatus('error')
|
||||
setError(data.error)
|
||||
} else {
|
||||
setOpenProject(data.project)
|
||||
setStatus('success')
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
|
|
@ -274,7 +276,6 @@ const My = () => {
|
|||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
console.log(Object.keys(votes).length)
|
||||
if (Object.keys(votes).length == 5) {
|
||||
setIsButtonActive(true)
|
||||
} else {
|
||||
|
|
@ -499,13 +500,12 @@ const My = () => {
|
|||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
console.log('the votes')
|
||||
console.log(creative)
|
||||
console.log(technical)
|
||||
console.log(overall)
|
||||
const isFirstRender = useRef(true);
|
||||
|
||||
submitVote(overall, technical, creative)
|
||||
useEffect(() => {
|
||||
if (overall.lengh > 0 && technical.length > 0 && creative.length > 0) { //skips first render
|
||||
submitVote(overall, technical, creative)
|
||||
}
|
||||
}, [endPage])
|
||||
|
||||
return endPage == true ? (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue