• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

GrottoCenter / grottocenter-api / 10996210778

23 Sep 2024 02:17PM UTC coverage: 46.158% (-2.8%) from 48.952%
10996210778

Pull #1306

github

vmarseguerra
feat(entities): adds delete / restore for document
Pull Request #1306: Adds delete / restore for entrance sub entities

740 of 2203 branches covered (33.59%)

Branch coverage included in aggregate %.

526 of 1293 new or added lines in 114 files covered. (40.68%)

23 existing lines in 18 files now uncovered.

2462 of 4734 relevant lines covered (52.01%)

4.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

8.7
/api/controllers/v1/massif/unlink-document.js
1
const RightService = require('../../../services/RightService');
1✔
2

3
module.exports = async (req, res) => {
1✔
4
  const hasRight = RightService.hasGroup(
×
5
    req.token.groups,
6
    RightService.G.MODERATOR
7
  );
8
  if (!hasRight) {
×
9
    return res.forbidden(
×
10
      'You are not authorized to remove a document from an entrance.'
11
    );
12
  }
13

14
  const massifId = req.param('massifId');
×
NEW
15
  const massif = await TMassif.findOne(massifId);
×
NEW
16
  if (!massif || massif.isDeleted) {
×
NEW
17
    return res.notFound({ message: `Massif of id ${massifId} not found.` });
×
18
  }
19

20
  const documentId = req.param('documentId');
×
21
  const document = await TDocument.findOne({ id: documentId });
×
22
  if (!document) {
×
23
    return res.notFound({ message: `Document of id ${documentId} not found.` });
×
24
  }
25

UNCOV
26
  await TMassif.removeFromCollection(massifId, 'documents', documentId);
×
27

28
  return res.ok();
×
29
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc