add extra details to install handler
This commit is contained in:
@@ -73,16 +73,18 @@ export const handlers = [
|
||||
);
|
||||
}),
|
||||
|
||||
rest.post<PostInstallRequest>(umbracoPath('/install/setup'), async (req, res, ctx) => {
|
||||
rest.post(umbracoPath('/install/setup'), async (req, res, ctx) => {
|
||||
await new Promise((resolve) => setTimeout(resolve, (Math.random() + 1) * 1000)); // simulate a delay of 1-2 seconds
|
||||
const body = await req.json<PostInstallRequest>();
|
||||
|
||||
if (req.body.database?.name === 'fail') {
|
||||
if (body.database?.name === 'fail') {
|
||||
return res(
|
||||
// Respond with a 200 status code
|
||||
ctx.status(400),
|
||||
ctx.json<ProblemDetails>({
|
||||
type: 'validation',
|
||||
status: 400,
|
||||
detail: 'Something went wrong',
|
||||
errors: {
|
||||
name: ['Database name is invalid'],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user