From a045f4a5124fcafbc66a0bbf3a7764bee3f1037f Mon Sep 17 00:00:00 2001 From: Valentyna Dudchak <dudchak.valya@gmail.com> Date: Wed, 4 Dec 2024 14:30:10 +0200 Subject: [PATCH] fixed ts error & isHash --- .../create-or-edit-offer/CreateOrEditOffer.constants.ts | 1 + .../offer-page/create-or-edit-offer/CreateOrEditOffer.tsx | 2 +- src/types/offer/interfaces/offer.interfaces.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/containers/offer-page/create-or-edit-offer/CreateOrEditOffer.constants.ts b/src/containers/offer-page/create-or-edit-offer/CreateOrEditOffer.constants.ts index 1228b5261..82854a83f 100644 --- a/src/containers/offer-page/create-or-edit-offer/CreateOrEditOffer.constants.ts +++ b/src/containers/offer-page/create-or-edit-offer/CreateOrEditOffer.constants.ts @@ -6,6 +6,7 @@ export const getInitialValues = (offer: Offer | null) => ({ subject: offer?.subject._id ?? '', proficiencyLevel: offer?.proficiencyLevel ?? [], languages: offer?.languages ?? [], + enrolledUsers: [], title: offer?.title ?? '', description: offer?.description ?? '', price: offer?.price.toString() ?? '', diff --git a/src/containers/offer-page/create-or-edit-offer/CreateOrEditOffer.tsx b/src/containers/offer-page/create-or-edit-offer/CreateOrEditOffer.tsx index c86ef7ca3..57637f456 100644 --- a/src/containers/offer-page/create-or-edit-offer/CreateOrEditOffer.tsx +++ b/src/containers/offer-page/create-or-edit-offer/CreateOrEditOffer.tsx @@ -60,7 +60,7 @@ const CreateOrEditOffer: FC<CreateOrUpdateOfferProps> = ({ : OfferActionsEnum.Create const onResponse = (response: Offer | null) => { - const isHash = hash === '#offer' ? true : undefined + const isHash = hash === '#offer' dispatch( openAlert( diff --git a/src/types/offer/interfaces/offer.interfaces.ts b/src/types/offer/interfaces/offer.interfaces.ts index b78efb25f..00d13b4d0 100644 --- a/src/types/offer/interfaces/offer.interfaces.ts +++ b/src/types/offer/interfaces/offer.interfaces.ts @@ -21,7 +21,7 @@ export interface Offer extends CommonEntityFields { proficiencyLevel: ProficiencyLevelEnum[] description: string languages: LanguagesEnum[] - enrolledUsers?: string[] + enrolledUsers: string[] authorRole: UserRoleEnum.Tutor | UserRoleEnum.Student author: Pick< UserResponse,