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

GrottoCenter / grottocenter-api / 21956074932

12 Feb 2026 04:55PM UTC coverage: 85.068% (-0.09%) from 85.162%
21956074932

push

github

ClemRz
fix(name): align h_name.name column to varchar(200) and add name length validation

2541 of 3147 branches covered (80.74%)

Branch coverage included in aggregate %.

31 of 37 new or added lines in 8 files covered. (83.78%)

2 existing lines in 1 file now uncovered.

5389 of 6175 relevant lines covered (87.27%)

23.15 hits per line

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

77.78
/api/controllers/v1/organization/create.js
1
const ControllerService = require('../../../services/ControllerService');
1✔
2
const GrottoService = require('../../../services/GrottoService');
1✔
3
const { toOrganization } = require('../../../services/mapping/converters');
1✔
4
const { validateNameLength } = require('../../../utils/nameValidation');
1✔
5

6
module.exports = async (req, res) => {
1✔
7
  // Check params
8
  if (!req.param('name')) {
1!
9
    return res.badRequest(
×
10
      'You must provide a name to create a new organization.'
11
    );
12
  }
13

14
  // Validate name length
15
  const nameError = validateNameLength(req.body.name?.text);
1✔
16
  if (nameError) {
1!
NEW
17
    return res.badRequest(nameError);
×
18
  }
19

20
  const cleanedData = {
1✔
21
    ...GrottoService.getConvertedDataFromClientRequest(req),
22
    author: req.token.id,
23
    dateInscription: new Date(),
24
  };
25

26
  const nameData = {
1✔
27
    author: req.token.id,
28
    language: req.param('name').language,
29
    text: req.param('name').text,
30
  };
31

32
  const newOrganizationPopulated = await GrottoService.createGrotto(
1✔
33
    req,
34
    cleanedData,
35
    nameData
36
  );
37

38
  return ControllerService.treatAndConvert(
1✔
39
    req,
40
    null,
41
    newOrganizationPopulated,
42
    { controllerMethod: 'GrottoController.create' },
43
    res,
44
    toOrganization
45
  );
46
};
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