Implemented kanban board page with lists of issues

This commit is contained in:
ireic
2019-12-12 17:26:57 +01:00
parent 3143f66a0f
commit 73b4ff97b2
73 changed files with 1343 additions and 561 deletions

View File

@@ -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;