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

scriptype / writ-cms / 29418287132

15 Jul 2026 01:10PM UTC coverage: 50.776% (-0.3%) from 51.032%
29418287132

push

github

scriptype
Implement contentTypes.delete

Also:
- Update path validation to account for paths residing naturally outside
of content directory (e.g. schema)

666 of 1351 branches covered (49.3%)

Branch coverage included in aggregate %.

4 of 28 new or added lines in 4 files covered. (14.29%)

1 existing line in 1 file now uncovered.

2278 of 4447 relevant lines covered (51.23%)

1472.09 hits per line

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

0.0
/src/cms/server/router/api/contentTypes.js
1
const express = require('express')
×
NEW
2
const skipWatcher = require('../../middleware/skipWatcher')
×
3

NEW
4
module.exports = (state) => express.Router()
×
5
  .get('/', async (req, res) => {
6
    try {
×
7
      res.status(200).json(
×
8
        await req.api.contentTypes.get()
9
      )
10
    } catch (e) {
11
      console.log('Error getting contentTypes', e)
×
12
      return res.status(500).send(e)
×
13
    }
14
  })
15
  .post('/', async (req, res) => {
16
    try {
×
17
      res.status(200).json(
×
18
        await req.api.contentTypes.create(req.body)
19
      )
20
    } catch (e) {
21
      console.log('Error creating contentType', e)
×
22
      return res.status(500).send(e)
×
23
    }
24
  })
25
  .delete('/', skipWatcher(state), async (req, res) => {
NEW
26
    try {
×
NEW
27
      await req.api.contentTypes.delete(req.query.path)
×
NEW
28
      state.setState(
×
29
        await req.api.ssg.build(state.getSSGOptions())
30
      )
NEW
31
      res.sendStatus(204)
×
32
    } catch (e) {
NEW
33
      if (e.message === 'content type not found') {
×
NEW
34
        return res.status(404).send(e)
×
35
      }
NEW
36
      console.log('Error deleting content type', e)
×
NEW
37
      res.status(500).send(e)
×
38
    }
39
  })
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