We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 28cd26f commit cc06752Copy full SHA for cc06752
__tests__/utils/index.js
@@ -6,8 +6,20 @@ const resetDatabase = async (knex) => {
6
const getAllProjects = (knex) => knex('projects').select('*')
7
const getAllGithubOrgs = (knex) => knex('github_organizations').select('*')
8
9
+const addProject = async (knex, { name, category }) => {
10
+ const [project] = await knex('projects').insert({ name, category }).returning('*')
11
+ return project
12
+}
13
+
14
+const addGithubOrg = async (knex, data) => {
15
+ const [githubOrg] = await knex('github_organizations').insert(data).returning('*')
16
+ return githubOrg
17
18
19
module.exports = {
20
resetDatabase,
21
getAllProjects,
- getAllGithubOrgs
22
+ getAllGithubOrgs,
23
+ addProject,
24
+ addGithubOrg
25
}
0 commit comments