Skip to content

Commit

Permalink
Add getLabel resolver
Browse files Browse the repository at this point in the history
This commit adds a getLabel resolver. This is currently just used by the
delete label API controller to get a label object before it's deleted
  • Loading branch information
Andrew Isherwood committed Sep 10, 2020
1 parent d5dd35d commit 7f80d9c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions resolvers/labels.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const labelResolvers = {
const sql = 'SELECT * FROM label l ORDER BY name ASC';
return pool.query(sql);
},
getLabel: ({ params }) =>
pool.query('SELECT * FROM label WHERE id = $1', [params.id]),
upsertLabel: ({ params, body }) => {
// If we have an ID, we're updating
if (params.hasOwnProperty('id') && params.id) {
Expand Down

0 comments on commit 7f80d9c

Please sign in to comment.