pop-up notifications

This commit is contained in:
2024-03-12 16:14:44 +03:00
parent 8797ba0778
commit 727d55798a
12 changed files with 186 additions and 40 deletions

View File

@ -6,6 +6,8 @@ import { getPartnerRequestInfo } from "@redux/outstaffingSlice";
import { apiRequest } from "@api/request";
import { useNotification } from "@hooks/useNotification";
import { Footer } from "@components/Common/Footer/Footer";
import { Navigation } from "@components/Navigation/Navigation";
import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs";
@ -47,6 +49,7 @@ export const PartnerAddRequest = () => {
"Выберите кол-во сотрудников"
);
const [inputs, setInputs] = useState({ title: "", description: "" });
const { showNotification } = useNotification();
if (
currentUrl[0] === "/profile/requests-edit" &&
@ -120,6 +123,11 @@ export const PartnerAddRequest = () => {
}
}).then(() => {
navigate("/profile/requests");
showNotification({
show: true,
text: "Вакансия успешно изменена",
type: "success"
});
});
} else {
apiRequest("/request/create-request", {
@ -138,6 +146,11 @@ export const PartnerAddRequest = () => {
}
}).then(() => {
navigate("/profile/requests");
showNotification({
show: true,
text: "Вакансия успешно создана",
type: "success"
});
});
}
};