Skip to content

Commit 4404d25

Browse files
AllesandriaAllesandria
authored andcommitted
routers for all tables connected to server
1 parent 2471b63 commit 4404d25

File tree

4 files changed

+24
-14
lines changed

4 files changed

+24
-14
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@ Build the migration(s) in Knex inside the `data/migrations` folder using appropr
5252

5353
- [ X] `resource_id` - primary key - table.increments("resource_id")
5454
- [ X] `resource_name` - required and unique - notNullable - varchar
55-
- [ ] `resource_description` - optional - varchar
55+
- [X ] `resource_description` - optional - varchar
5656

57-
- [ ] A **task** is one of the steps needed to complete a project and is stored in a `tasks` table with the following columns:
57+
- [ X] A **task** is one of the steps needed to complete a project and is stored in a `tasks` table with the following columns:
5858

59-
- [ ] `task_id` - primary key - table.increments("task_id")
60-
- [ ] `task_description` - required - notNullable - varchar
61-
- [ ] `task_notes` - optional - varchar
62-
- [ ] `task_completed` - the database defaults it to `false` (integer 0) if not provided -boolean (false)
63-
- [ ] `project_id` - required and points to an actual `project_id` in the `projects` table - foreign key - notnullable
59+
- [X ] `task_id` - primary key - table.increments("task_id")
60+
- [X ] `task_description` - required - notNullable - varchar
61+
- [ X] `task_notes` - optional - varchar
62+
- [ X] `task_completed` - the database defaults it to `false` (integer 0) if not provided -boolean (false)
63+
- [ X] `project_id` - required and points to an actual `project_id` in the `projects` table - foreign key - notnullable
6464

65-
- [ ] A **resource assignment** connects a resource and a project, and is stored in a `project_resources` table. You decide what columns to use.
66-
- [ ] `project_name`
67-
- [ ] `resource_name`
65+
- [ X] A **resource assignment** connects a resource and a project, and is stored in a `project_resources` table. You decide what columns to use.
66+
- [ X] `project_name`
67+
- [ X] `resource_name`
6868

6969
### Required Endpoints
7070

api/resource/router.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
// build your `/api/resources` router here
2+
const express = require('express');
3+
const router = express.Router();
4+
5+
6+
module.exports = router;

api/server.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ server.use(express.json());
99
const projectRouter = require('./project/router');
1010
server.use('/api/project', projectRouter);
1111

12-
// const resourceRouter = require('./resource/router');
13-
// server.use('/api/resource', resourceRouter);
12+
const resourceRouter = require('./resource/router');
13+
server.use('/api/resource', resourceRouter);
1414

15-
// const taskRouter = require('./task/router');
16-
// server.use('/api/task', taskRouter);
15+
const taskRouter = require('./task/router');
16+
server.use('/api/task', taskRouter);
1717

1818
//const router = express.Router();
1919

api/task/router.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
// build your `/api/tasks` router here
2+
const express = require('express');
3+
const router = express.Router();
4+
5+
6+
module.exports = router;

0 commit comments

Comments
 (0)