Improve comments

This commit is contained in:
Nischay
2024-04-21 11:23:11 +05:30
parent 59bf7ef252
commit 380a070e71

View File

@@ -35,14 +35,14 @@ export function sendGIF(url){
if (xhr.readyState === 4) { if (xhr.readyState === 4) {
if (xhr.status === 200) { if (xhr.status === 200) {
const responseData = xhr.responseText; const responseData = xhr.responseText;
// Call function A with the response data // Call uploadFile with response data
api.uploadFile(responseData) api.uploadFile(responseData)
.then(result => { .then(result => {
console.log("Here's the result:"+result); console.log("Here's the result:"+result);
resolve(result); // Resolve the outer promise with the result from A resolve(result);
}) })
.catch(error => { .catch(error => {
reject(error); // Reject the outer promise if function A fails reject(error);
}); });
} else { } else {
reject(new Error('Failed to fetch data')); // Reject the outer promise if fetching data fails reject(new Error('Failed to fetch data')); // Reject the outer promise if fetching data fails