Implemented kanban board page with lists of issues
This commit is contained in:
@@ -2,36 +2,20 @@ import express from 'express';
|
||||
|
||||
import { Project } from 'entities';
|
||||
import { catchErrors } from 'errors';
|
||||
import { findEntityOrThrow, updateEntity, deleteEntity, createEntity } from 'utils/typeorm';
|
||||
import { findEntityOrThrow, updateEntity } from 'utils/typeorm';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.get(
|
||||
'/projects',
|
||||
catchErrors(async (_req, res) => {
|
||||
const projects = await Project.find();
|
||||
res.respond({ projects });
|
||||
}),
|
||||
);
|
||||
|
||||
router.get(
|
||||
'/projects/:projectId',
|
||||
'/project',
|
||||
catchErrors(async (req, res) => {
|
||||
const project = await findEntityOrThrow(Project, req.params.projectId, {
|
||||
const project = await findEntityOrThrow(Project, req.currentUser.projectId, {
|
||||
relations: ['users', 'issues', 'issues.comments'],
|
||||
});
|
||||
res.respond({ project });
|
||||
}),
|
||||
);
|
||||
|
||||
router.post(
|
||||
'/projects',
|
||||
catchErrors(async (req, res) => {
|
||||
const project = await createEntity(Project, req.body);
|
||||
res.respond({ project });
|
||||
}),
|
||||
);
|
||||
|
||||
router.put(
|
||||
'/projects/:projectId',
|
||||
catchErrors(async (req, res) => {
|
||||
@@ -40,12 +24,4 @@ router.put(
|
||||
}),
|
||||
);
|
||||
|
||||
router.delete(
|
||||
'/projects/:projectId',
|
||||
catchErrors(async (req, res) => {
|
||||
const project = await deleteEntity(Project, req.params.projectId);
|
||||
res.respond({ project });
|
||||
}),
|
||||
);
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user