Skip to content

Commit

Permalink
Merge pull request #277 from LL08-MathematicalModelling-dowell/ft-pranai
Browse files Browse the repository at this point in the history
fixed issues and changed nps scale page
  • Loading branch information
Pranai-1 authored Jun 10, 2024
2 parents 8539eef + f11f2bb commit 29bc093
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/pages/scales/report/NPSScale.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ else


const body = {
"scale_id":"665a8277d5d158ec8391aaf7",
"scale_id":scaleId,
"workspace_id": workspaceId,
"username": "CustomerSupport",
"scale_type": "nps",
Expand Down Expand Up @@ -87,6 +87,7 @@ else
border-radius: 50%;
border-top-color: #fff;
animation: spin 1s linear infinite;
margin-top:4px
}
`}
</style>
Expand All @@ -96,7 +97,7 @@ else
onClick={() => submit(value)}
className="md:text-[20px] sm:text-[14px] py-[1px] px-[6px] sm:p-2 sm:px-3 rounded-full md:px-4 cursor-pointer bg-orange-400 text-white font-bold hover:bg-indigo-600"
>
{submitted === value ? <div className="loader flex justify-center items-center"></div> : value}
{submitted === value ? <div className="loader flex justify-center items-center "></div> : value}
</button>
))}
</div>
Expand Down
8 changes: 6 additions & 2 deletions src/pages/scales/report/NpsScaleTest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ else
)
}
async function submit(index){

setSubmitted(index)
const headers = {
"Content-Type": "application/json"
Expand All @@ -37,8 +38,8 @@ setSubmitted(index)
"scale_type": "nps_lite",
"user_type": true,
"score": index,
"channel": channelName,
"instance": instanceName
"channel_name": channelName,
"instance_name": instanceName
};

try {
Expand All @@ -50,6 +51,8 @@ setSubmitted(index)
}
} catch (error) {
console.error("Error submitting response:", error.response ? error.response.data : error.message);
setSubmitted(-2)

}
}

Expand Down Expand Up @@ -112,6 +115,7 @@ setSubmitted(index)
</button>
</div>
</div>
{submitted==-2 && <p className="text-red-600 p-2 mt-2 self-center text-[12px] sm:text-[16px]">Unable to submit your feedback at the moment</p>}
</div>
)
}
Expand Down

0 comments on commit 29bc093

Please sign in to comment.