Collections got descriptions now

This commit is contained in:
Tom Moor
2018-11-18 01:13:28 -08:00
parent 3718a9609d
commit 919bca6769
7 changed files with 110 additions and 48 deletions

View File

@@ -77,7 +77,7 @@ router.post('collections.exportAll', auth(), async ctx => {
});
router.post('collections.update', auth(), async ctx => {
const { id, name, color } = ctx.body;
const { id, name, description, color } = ctx.body;
ctx.assertPresent(name, 'name is required');
if (color)
ctx.assertHexColor(color, 'Invalid hex value (please use format #FFFFFF)');
@@ -86,6 +86,7 @@ router.post('collections.update', auth(), async ctx => {
authorize(ctx.state.user, 'update', collection);
collection.name = name;
collection.description = description;
collection.color = color;
await collection.save();