Updated TemplatePro

This commit is contained in:
Daniele Teti 2024-09-09 12:42:30 +02:00
parent a098584994
commit 8116c25e2f
2 changed files with 4 additions and 3 deletions

View File

@ -54,7 +54,8 @@ var
begin
ContentType := TMVCMediaType.APPLICATION_JSON;
lJObj := TJSONObject.Create;
lJObj.S['message'] := 'This is protected content accessible only by user1';
lJObj.S['message'] := 'This is protected content accessible only by user1: you are ' +
Context.LoggedUser.UserName + ' logged since ' + DateTimeToStr(Context.LoggedUser.LoggedSince);
lJArr := lJObj.A['querystringparameters'];
lQueryParams := Context.Request.QueryStringParams;

View File

@ -2453,9 +2453,9 @@ begin
GetVariables.Add(Name, TVarDataSource.Create(TJDOJsonObject(Value.AsObject), [viJSONObject]));
end
else
if Value.AsObject is TJDOJsonObject then
if Value.AsObject is TJDOJsonArray then
begin
GetVariables.Add(Name, TVarDataSource.Create(TJDOJsonObject(Value.AsObject), [viJSONObject]));
raise ETProRenderException.Create('JSONArray cannot be used directly [HINT] Define a JSONObject variable with a JSONArray property');
end
else
begin