Skip to content

Commit

Permalink
Enhancements to Event Creation and Management UI/UX (#96)
Browse files Browse the repository at this point in the history
* updated

* ehanced UI
  • Loading branch information
Laxmi01345 authored Oct 15, 2024
1 parent c7ba63a commit b3901d9
Show file tree
Hide file tree
Showing 7 changed files with 333 additions and 227 deletions.
1 change: 1 addition & 0 deletions backend/dist/config/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ exports.MESSAGES = {
ERROR_CREATING_EVENT: "An error occurred while creating the event.",
FETCH_EVENTS_SUCCESS: "Events fetched successfully.",
UPDATE_EVENT_SUCCESS: "Event updated successfully.",
ERROR_FETCHING_EVENT: "An error occurred while fetching the single event.",
},
GENERIC: {
INTERNAL_SERVER_ERROR: "Internal Server Error",
Expand Down
21 changes: 20 additions & 1 deletion backend/dist/controllers/event.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createQuiz = exports.getAllEventData = exports.createEvent = exports.updateEvent = exports.getClubEventData = exports.deleteEvent = void 0;
exports.getSingleEventData = exports.createQuiz = exports.getAllEventData = exports.createEvent = exports.updateEvent = exports.getClubEventData = exports.deleteEvent = void 0;
const database_config_1 = require("../config/database.config");
const const_1 = require("../config/const");
const logger_1 = __importDefault(require("../config/logger"));
Expand Down Expand Up @@ -154,3 +154,22 @@ const createQuiz = (req, res) => __awaiter(void 0, void 0, void 0, function* ()
}
});
exports.createQuiz = createQuiz;
const getSingleEventData = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
const eventId = Number(req.query.EventID);
try {
const event = yield database_config_1.prisma.event.findUnique({
where: { EventID: eventId },
});
if (!event) {
logger_1.default.warn(`Event not found for EventID: ${eventId}`);
return res.status(404).json({ error: const_1.MESSAGES.EVENT.EVENT_NOT_FOUND });
}
logger_1.default.info(`Fetched event data for EventID: ${eventId}`);
res.json(event);
}
catch (error) {
logger_1.default.error(`${const_1.MESSAGES.EVENT.ERROR_FETCHING_EVENT}: ${error}`);
res.status(500).json({ error: const_1.MESSAGES.EVENT.ERROR_FETCHING_EVENT });
}
});
exports.getSingleEventData = getSingleEventData;
1 change: 1 addition & 0 deletions backend/dist/routes/event.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const router = (0, express_1.Router)();
router.delete("/deleteEvent", event_controller_1.deleteEvent);
//get all events
router.get("/getAllEventData", event_controller_1.getAllEventData);
router.get("/getSingleEventData", event_controller_1.getSingleEventData);
//get all events for a club
router.get("/getClubEventData", event_controller_1.getClubEventData);
router.put("/update-event", event_controller_1.updateEvent);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/appComponents/EventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type EventCardProps = {

const EventCard: React.FC<EventCardProps> = ({ name, description, time }) => {
return (
<div className="hover:scale-[101%] bg-white transform transition-all duration-500 text-gray-900 rounded-lg shadow-md p-6 flex flex-col justify-between">
<div className="hover:scale-[101%] bg-white transform transition-all duration-500 text-gray-900 rounded-lg shadow-md p-1 flex flex-col justify-between">
<h2 className="mb-2 text-xl font-bold">{name}</h2>
<p className="mb-4 text-gray-600">{description}</p>
<div className="flex items-center justify-between">
Expand Down
Loading

0 comments on commit b3901d9

Please sign in to comment.