Correctly add pre handlers and post handlers to routes nodes.

This commit is contained in:
Madeorsk 2024-10-18 15:09:11 +02:00
parent 0e9cdcb6eb
commit 4649021978
Signed by: Madeorsk
GPG key ID: 677E51CA765BB79F

View file

@ -195,6 +195,8 @@ pub const RouteNode = struct {
.handle = definition.handle, .handle = definition.handle,
.handleNotFound = definition.handleNotFound, .handleNotFound = definition.handleNotFound,
.handleError = definition.handleError, .handleError = definition.handleError,
.preHandle = definition.preHandle,
.postHandle = definition.postHandle,
}); });
} }
else else
@ -203,6 +205,8 @@ pub const RouteNode = struct {
childTree.handle = definition.handle; childTree.handle = definition.handle;
childTree.handleNotFound = definition.handleNotFound; childTree.handleNotFound = definition.handleNotFound;
childTree.handleError = definition.handleError; childTree.handleError = definition.handleError;
childTree.preHandle = definition.preHandle;
childTree.postHandle = definition.postHandle;
if (definition.children) |children| if (definition.children) |children|
{ // If there are children, recursively parse them. { // If there are children, recursively parse them.