Skip to content

Commit

Permalink
fix:registration nitr student
Browse files Browse the repository at this point in the history
  • Loading branch information
AYANscyy2 committed Nov 2, 2024
1 parent 831e319 commit e2f9a73
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/EventsPage/Event/Event.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const initialState = {
uid: null,
registered: false,
hasPaid: false,
isNitr: false,
isCurrentSlideId: 0,
};

Expand Down Expand Up @@ -49,9 +50,9 @@ export const Events = ({ EventItem }) => {
const userData = Cookies.get('userDataDB');

if (userData) {
const { id, hasPaid } = JSON.parse(userData);
const { id, hasPaid, isNitr } = JSON.parse(userData);

setState((prev) => ({ ...prev, uid: id, hasPaid }));
setState((prev) => ({ ...prev, uid: id, hasPaid, isNitr }));
}
} catch (error) {
console.error('Error parsing user data cookie:', error);
Expand Down Expand Up @@ -115,7 +116,7 @@ export const Events = ({ EventItem }) => {
}));

try {
if (state.hasPaid) {
if (state.hasPaid || state.isNitr) {
const response = await handleLoadingAndToast(
registerForEvent({
variables: {
Expand Down

0 comments on commit e2f9a73

Please sign in to comment.