Skip to content

Commit

Permalink
Aggiunta route per le collezioni collegate al documento.
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard1984 committed Nov 4, 2018
1 parent 3c71976 commit d9e708a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/routes/api/v1/routes/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@ router.patch('/:id', authenticate, editDocument, asyncMiddleware(async (req, res
}
}))

router.get('/:id/collections', authenticate, asyncMiddleware(async (req, res) => {
const {id} = req.params

const collections = await DocumentCollection.find({
documents: id
})

res.status(200).json(collections)
}))

/*
* Utente loggato
* Utente proprietario o admin
Expand Down

0 comments on commit d9e708a

Please sign in to comment.