Bläddra i källkod

Fixed bug 518

feature/587
jovan.cirkovic 3 år sedan
förälder
incheckning
e7be2d044f

+ 0
- 1
src/App.js Visa fil

@@ -78,7 +78,6 @@ const App = () => {
<Router history={history}>
<Helmet>
<title>{i18next.t("app.title")}</title>
</Helmet>
<StyledEngineProvider injectFirst>
<Header />

+ 1
- 1
src/components/Cards/CreateOfferCard/CreateOffer.js Visa fil

@@ -18,13 +18,13 @@ import {
fetchOffers,
fetchProfileOffers,
} from "../../../store/actions/offers/offersActions";
import { selectUserId } from "../../../store/selectors/loginSelectors";
import { editOneOffer } from "../../../store/actions/offers/offersActions";
import { ReactComponent as ArrowBack } from "../../../assets/images/svg/arrow-back.svg";
// import { ReactComponent as CloseButton } from "../../../assets/images/svg/close-modal.svg";
import { useTranslation } from "react-i18next";
import BackdropComponent from "../../MUI/BackdropComponent";
import CloseButton from "./CloseButton/CloseButton";
import { selectUserId } from "../../../store/selectors/loginSelectors";

const CreateOffer = ({ closeCreateOfferModal, editOffer, offer }) => {
const dispatch = useDispatch();

+ 1
- 0
src/components/ProfileCard/EditProfile/EditProfile.js Visa fil

@@ -123,6 +123,7 @@ const EditProfile = (props) => {
<InputFieldLabel leftText={t("common.labelPIB")} />
<InputField
name="firmPIB"
type="number"
value={formik.values.firmPIB}
onChange={formik.handleChange}
error={formik.touched.firmPIB && formik.errors.firmPIB}

+ 6
- 2
src/store/saga/categoriesSaga.js Visa fil

@@ -1,14 +1,18 @@
import { all, call, put, takeLatest } from "@redux-saga/core/effects";
import { attemptFetchCategories } from "../../request/categoriesRequest";
import { CATEGORIES_FETCH } from "../actions/categories/categoriesActionConstants";
import { fetchCategoriesError, fetchCategoriesSuccess, setCategories } from "../actions/categories/categoriesActions";
import {
fetchCategoriesError,
fetchCategoriesSuccess,
setCategories,
} from "../actions/categories/categoriesActions";

function* fetchCategories() {
try {
const { data } = yield call(attemptFetchCategories);
yield put(setCategories(data));
yield put(fetchCategoriesSuccess());
} catch(e) {
} catch (e) {
yield put(fetchCategoriesError());
console.log(e);
}

+ 4
- 3
src/store/saga/offersSaga.js Visa fil

@@ -72,7 +72,7 @@ function* fetchOffers(payload) {
attemptFetchOffers,
"?" + newQueryString.toString()
);
console.log('data::::::::: ', data.data)
console.log("data::::::::: ", data.data);
yield put(setTotalOffers(data.data.total));
yield put(setOffers(data.data.items.regularOffers));
yield put(setPinnedOffers(data.data.items.pinnedOffers));
@@ -131,7 +131,7 @@ function* createOffer(payload) {

function* fetchOneOffer(payload) {
try {
const data = yield call(attemptFetchOneOffer, payload.payload)
const data = yield call(attemptFetchOneOffer, payload.payload);
yield put(fetchOneOfferSuccess(data.data));
} catch (e) {
console.log(e.response.status);
@@ -158,7 +158,8 @@ function* fetchMineOffers() {
function* fetchProfileOffers(payload) {
try {
const userId = payload.payload;
if (!userId || userId?.length === 0) throw new Error("User id is not defined!");
if (!userId || userId?.length === 0)
throw new Error("User id is not defined!");
const data = yield call(attemptFetchProfileOffers, userId);
yield put(setProfileOffers(data.data));
yield put(fetchProfileOffersSuccess());

+ 2
- 1
src/store/saga/registerSaga.js Visa fil

@@ -33,12 +33,13 @@ function* fetchRegisterUser({ payload }) {
if (payload.values.website?.length === 0)
delete requestData.company.contacts.web;
yield call(attemptRegister, requestData);
console.log("jos nije crash");
if (payload.handleResponseSuccess) {
yield call(payload.handleResponseSuccess);
}
yield putRequest(fetchRegisterUserSuccess());
} catch (e) {
console.log(e)
console.log(e);
let type = "server";
if (
e?.response?.data?.toString() === "User with email already exists" ||

+ 2
- 1
src/validations/editProfileValidation.js Visa fil

@@ -4,7 +4,8 @@ export default Yup.object().shape({
firmName: Yup.string().required(i18n.t("editProfile.labelNameRequired")),
firmPIB: Yup.string()
.required(i18n.t("editProfile.labelPIBRequired"))
.min(9, i18n.t("register.PIBnoOfCharacters")),
.min(9, i18n.t("register.PIBnoOfCharacters"))
.max(9, i18n.t("register.PIBnoOfCharacters")),
firmLocation: Yup.string().required(
i18n.t("editProfile.labelLocationRequired")
),

Laddar…
Avbryt
Spara