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

GrottoCenter / grottocenter-api / 25457721116

06 May 2026 07:47PM UTC coverage: 86.494% (-0.2%) from 86.702%
25457721116

Pull #1565

github

ClemRz
feat(account): consolidate account endpoints and add locale-aware emails

- Add GET /api/v1/account for authenticated user's private data
- Add PATCH /api/v1/account for self-service updates (name, surname,
  nickname, email, password, language)
- Restrict PUT /api/v1/cavers/:caverId to admin-only
- Add optional language param to sign-up endpoint
- Add locale support to send-email helper for recipient-language emails
- Remove orphaned change-email, change-alert-for-news controllers
- Update Swagger spec with consolidated /account path
- Update tests to match new endpoint behavior
- Silence pre-existing func-names lint warnings in property tests
Pull Request #1565: feat(account): consolidate endpoints and add locale-aware emails

3047 of 3661 branches covered (83.23%)

Branch coverage included in aggregate %.

71 of 91 new or added lines in 8 files covered. (78.02%)

27 existing lines in 6 files now uncovered.

6297 of 7142 relevant lines covered (88.17%)

53.2 hits per line

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

83.33
/api/services/LanguageService.js
1
/**
2
 * LanguageService.js
3
 *
4
 * @description :: Shared helpers for language/locale resolution.
5
 */
6

7
module.exports = {
9✔
8
  /**
9
   * Resolve a TLanguage FK id to an ISO 639-1 locale code (e.g. "fr", "en").
10
   *
11
   * @param {string|number|null|undefined} languageId - The TLanguage id (ISO 639-3 code or numeric FK)
12
   * @returns {Promise<string|undefined>} The ISO 639-1 part1 code, or undefined if not resolvable
13
   */
14
  getLocale: async (languageId) => {
15
    if (!languageId) return undefined;
288✔
16
    const lang = await TLanguage.findOne({ id: languageId });
45✔
17
    if (lang && lang.part1) {
45!
18
      return lang.part1;
45✔
19
    }
NEW
20
    return undefined;
×
21
  },
22
};
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