ENCOA-114: In Exam List and Group List provide Fuzzy Search Filter

This commit is contained in:
Tiago Ribeiro
2024-08-27 10:53:50 +01:00
parent 82233c7d53
commit cd85c71aec
3 changed files with 172 additions and 212 deletions

View File

@@ -109,23 +109,6 @@ export default function UserList({
.finally(reload);
};
const updateAccountType = (user: User, type: Type) => {
if (!confirm(`Are you sure you want to update ${user.name}'s account from ${capitalize(user.type)} to ${capitalize(type)}?`)) return;
axios
.post<{user?: User; ok?: boolean}>(`/api/users/update?id=${user.id}`, {
...user,
type,
})
.then(() => {
toast.success("User type updated successfully!");
reload();
})
.catch(() => {
toast.error("Something went wrong!", {toastId: "update-error"});
});
};
const verifyAccount = (user: User) => {
axios
.post<{user?: User; ok?: boolean}>(`/api/users/update?id=${user.id}`, {