cover me email request routine
This commit is contained in:
@ -51,6 +51,23 @@ export default function MySchedulePage({ assignments }) {
|
||||
console.log("error", error);
|
||||
});
|
||||
};
|
||||
|
||||
const searchReplacement = (assignmentId) => {
|
||||
axiosInstance.post('/api/email?action=sendCoverMeRequestByEmail', {
|
||||
assignmentId: assignmentId,
|
||||
}).then(response => {
|
||||
console.log("response", response);
|
||||
//toast success and confirm the change
|
||||
toast.success("Заявката за заместник е изпратена!", {
|
||||
onClose: () => {
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
}).catch(error => {
|
||||
console.log("error", error);
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<ProtectedRoute allowedRoles={[UserRole.ADMIN, UserRole.POWERUSER, UserRole.USER]}>
|
||||
@ -101,14 +118,14 @@ export default function MySchedulePage({ assignments }) {
|
||||
setIsModalOpen(true)
|
||||
}}
|
||||
>
|
||||
Заместник
|
||||
Избери Заместник
|
||||
</button>
|
||||
{/* <button
|
||||
className="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
||||
<button
|
||||
className="inline-flex items-center px-3 mx-2 py-2 border border-transparent text-sm leading-4 font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
|
||||
onClick={() => searchReplacement(assignment.id)}
|
||||
>
|
||||
Търси заместник
|
||||
</button> */}
|
||||
</button>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
Reference in New Issue
Block a user