Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Commit 4e883d6

Browse files
committed
🚑 FIX: Update tests after PR #42
1 parent 810a34e commit 4e883d6

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

.github/workflows/test_middleware.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Tests
33
on:
44
push:
55
branches:
6-
- master
6+
- '**'
77

88
jobs:
99
build:
@@ -21,4 +21,4 @@ jobs:
2121
with:
2222
redis-version: ${{ matrix.redis-version }}
2323
- run: npm install
24-
- run: npm test
24+
- run: npm test

lib/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -325,22 +325,23 @@ const Cache = (strapi) => {
325325
// strapi < 3.4.0
326326
// @see https://github.com/strapi/strapi/blob/v3.3.4/packages/strapi-plugin-content-manager/config/routes.json
327327
router.post('/content-manager/explorer/:model', bustAdmin);
328-
router.put('/content-manager/explorer/:model/:id', bustAdmin);
328+
router.put('/content-manager/explorer/:model/:id*', bustAdmin);
329329
router.delete('/content-manager/explorer/deleteAll/:model', bustAdmin);
330-
router.delete('/content-manager/explorer/:model/:id', bustAdmin);
331-
router.post('/content-manager/explorer/:model/publish/:id', bustAdmin);
332-
router.post('/content-manager/explorer/:model/unpublish/:id', bustAdmin);
330+
router.delete('/content-manager/explorer/:model/:id*', bustAdmin);
331+
router.post('/content-manager/explorer/:model/publish/:id*', bustAdmin);
332+
router.post('/content-manager/explorer/:model/unpublish/:id*', bustAdmin);
333333
} else {
334334
// strapi >= 3.4.0
335335
// @see https://github.com/strapi/strapi/blob/master/packages/strapi-plugin-content-manager/config/routes.json
336336
router.put(`/content-manager/single-types/:model`, bustAdmin);
337337
router.delete(`/content-manager/single-types/:model`, bustAdmin);
338+
router.post(`/content-manager/single-types/:model`, bustAdmin);
338339
router.post(`/content-manager/single-types/:model/actions/publish`, bustAdmin);
339340
router.post(`/content-manager/single-types/:model/actions/unpublish`, bustAdmin);
340341

341342
router.post(`/content-manager/collection-types/:model`, bustAdmin);
342-
router.put(`/content-manager/collection-types/:model/:id`, bustAdmin);
343-
router.delete(`/content-manager/collection-types/:model/:id`, bustAdmin);
343+
router.put(`/content-manager/collection-types/:model/:id*`, bustAdmin);
344+
router.delete(`/content-manager/collection-types/:model/:id*`, bustAdmin);
344345
router.post(`/content-manager/collection-types/:model/:id/actions/publish`, bustAdmin);
345346
router.post(`/content-manager/collection-types/:model/:id/actions/unpublish`, bustAdmin);
346347
router.post(`/content-manager/collection-types/:model/actions/bulkDelete`, bustAdmin);

tests/cache.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ describe('Caching', () => {
238238

239239
expect(requests).to.have.lengthOf(1);
240240

241-
const res2 = await agent(strapi.app)[method]('/content-manager/collection-types/application::academy.academy/publish/1').expect(200);
241+
const res2 = await agent(strapi.app)[method]('/content-manager/collection-types/application::academy.academy/1/actions/publish').expect(200);
242242

243243
expect(res2.body.uid).to.equal(res1.body.uid + 1);
244244
expect(requests).to.have.lengthOf(2);

0 commit comments

Comments
 (0)