Skip to content
This repository was archived by the owner on Sep 16, 2025. It is now read-only.

Commit 1ccfbba

Browse files
refactor(slug-controller): add note that model names are case sensitive in error message (#5)
chore(slug-controller): `pah` should be `path`
1 parent 35295e5 commit 1ccfbba

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

server/controllers/slug-controller.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = ({ strapi }) => ({
1010

1111
try {
1212
if (!modelName) {
13-
throw Error('A model name pah variable is required.');
13+
throw Error('A model name path variable is required.');
1414
}
1515

1616
if (!slug) {
@@ -20,13 +20,14 @@ module.exports = ({ strapi }) => ({
2020
const model = models[modelName];
2121
if (!model) {
2222
throw Error(
23-
`${modelName} model name not found, all models must be defined in the settings.`
23+
`${modelName} model name not found, all models must be defined in the settings and are case sensitive.`
2424
);
2525
}
2626

2727
const { uid, field } = model;
28-
let query = ctx.query;
2928

29+
// add slug filter to any already existing query restrictions
30+
let query = ctx.query;
3031
if (!query.filters) {
3132
query.filters = {};
3233
}

0 commit comments

Comments
 (0)