update redirects to post fastify 5.x.x style

This commit is contained in:
Holly Stubbs 2024-09-20 00:03:32 +01:00
parent 1f69eff4bb
commit 1d9e0d1dd2
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E

View file

@ -37,12 +37,12 @@ export default class RequestCtx {
const controllerName = controller ?? this.controllerName;
if (action === "index") {
if (controllerName === "home") {
return this.res.redirect(302, `/`);
return this.res.redirect(`/`, 302);
} else {
return this.res.redirect(302, `/${controllerName}`);
return this.res.redirect(`/${controllerName}`, 302);
}
} else {
return this.res.redirect(302, `/${controllerName}/${action}`);
return this.res.redirect(`/${controllerName}/${action}`, 302);
}
}