(req)
| 71 | }; |
| 72 | |
| 73 | async function createSchema(req) { |
| 74 | checkIfDefinedSchemasIsUsed(req); |
| 75 | if (req.auth.isReadOnly) { |
| 76 | throw createSanitizedError( |
| 77 | Parse.Error.OPERATION_FORBIDDEN, |
| 78 | "read-only masterKey isn't allowed to create a schema.", |
| 79 | req.config |
| 80 | ); |
| 81 | } |
| 82 | if (req.params.className && req.body?.className) { |
| 83 | if (req.params.className != req.body.className) { |
| 84 | return classNameMismatchResponse(req.body.className, req.params.className); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | const className = req.params.className || req.body?.className; |
| 89 | if (!className) { |
| 90 | throw new Parse.Error(135, `POST ${req.path} needs a class name.`); |
| 91 | } |
| 92 | |
| 93 | return await internalCreateSchema(className, req.body || {}, req.config); |
| 94 | } |
| 95 | |
| 96 | function modifySchema(req) { |
| 97 | checkIfDefinedSchemasIsUsed(req); |
nothing calls this directly
no test coverage detected
searching dependent graphs…