Add error message from server when voting

This commit is contained in:
Ajay Ramachandran
2021-01-26 21:57:43 -05:00
parent 41fee58ab9
commit 67f2798672
4 changed files with 15 additions and 11 deletions

View File

@@ -125,19 +125,22 @@ async function submitVote(type: number, UUID: string, category: string) {
if (response.ok) {
return {
successType: 1
successType: 1,
responseText: await response.text()
};
} else if (response.status == 405) {
//duplicate vote
return {
successType: 0,
statusCode: response.status
statusCode: response.status,
responseText: await response.text()
};
} else {
//error while connect
return {
successType: -1,
statusCode: response.status
statusCode: response.status,
responseText: await response.text()
};
}
}