feat: Upgrade to express 5.0.1 (#9530)
BREAKING CHANGE: This upgrades the internally used Express framework from version 4 to 5, which may be a breaking change. If Parse Server is set up to be mounted on an Express application, we recommend to also use version 5 of the Express framework to avoid any compatibility issues. Note that even if there are no issues after upgrading, future releases of Parse Server may introduce issues if Parse Server internally relies on Express 5-specific features which are unsupported by the Express version on which it is mounted. See the Express [migration guide](https://expressjs.com/en/guide/migrating-5.html) and [release announcement](https://expressjs.com/2024/10/15/v5-release.html#breaking-changes) for more info.
This commit is contained in:
@@ -77,18 +77,18 @@ async function createSchema(req) {
|
||||
"read-only masterKey isn't allowed to create a schema."
|
||||
);
|
||||
}
|
||||
if (req.params.className && req.body.className) {
|
||||
if (req.params.className && req.body?.className) {
|
||||
if (req.params.className != req.body.className) {
|
||||
return classNameMismatchResponse(req.body.className, req.params.className);
|
||||
}
|
||||
}
|
||||
|
||||
const className = req.params.className || req.body.className;
|
||||
const className = req.params.className || req.body?.className;
|
||||
if (!className) {
|
||||
throw new Parse.Error(135, `POST ${req.path} needs a class name.`);
|
||||
}
|
||||
|
||||
return await internalCreateSchema(className, req.body, req.config);
|
||||
return await internalCreateSchema(className, req.body || {}, req.config);
|
||||
}
|
||||
|
||||
function modifySchema(req) {
|
||||
@@ -99,12 +99,12 @@ function modifySchema(req) {
|
||||
"read-only masterKey isn't allowed to update a schema."
|
||||
);
|
||||
}
|
||||
if (req.body.className && req.body.className != req.params.className) {
|
||||
if (req.body?.className && req.body.className != req.params.className) {
|
||||
return classNameMismatchResponse(req.body.className, req.params.className);
|
||||
}
|
||||
const className = req.params.className;
|
||||
|
||||
return internalUpdateSchema(className, req.body, req.config);
|
||||
return internalUpdateSchema(className, req.body || {}, req.config);
|
||||
}
|
||||
|
||||
const deleteSchema = req => {
|
||||
|
||||
Reference in New Issue
Block a user