Skip to content

Commit

Permalink
hook for backend integration and removed tableland
Browse files Browse the repository at this point in the history
  • Loading branch information
shivam6862 committed Feb 1, 2024
1 parent 020b9a1 commit 9f2aff1
Show file tree
Hide file tree
Showing 13 changed files with 1,768 additions and 3,658 deletions.
17 changes: 17 additions & 0 deletions backend/controllers/hackathonController.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,23 @@ exports.getAllProjects = catchAsync(async (req, res, next) => {
return next(new AppError("no such hackathon exists", 400));
}
});
exports.getAllHackathon = catchAsync(async (req, res, next) => {
const hackathons = await hackathonModel.find();
res.status(200).json({
hackathons,
message: "found all hackathons",
});
});
exports.getHackathonByPagination = catchAsync(async (req, res, next) => {
const page = req.params.page * 1 || 1;
const limit = req.params.limit * 1 || 10;
const skip = (page - 1) * limit;
const hackathons = await hackathonModel.find().skip(skip).limit(limit);
res.status(200).json({
hackathons,
message: "found all hackathons",
});
});
exports.getHackathon = catchAsync(async (req, res, next) => {
const hackathonID = req.params.hackathonID;
const hackathon = await hackathonModel.findById(hackathonID);
Expand Down
Loading

0 comments on commit 9f2aff1

Please sign in to comment.