updated to hide hidden fields in frontentmetadata, updated error responses

This commit is contained in:
Tim Chamberlain
2023-05-05 13:05:35 -05:00
parent fff7f5ad8e
commit a1b96c6cee
2 changed files with 8 additions and 4 deletions

View File

@ -91,9 +91,13 @@ public class QFrontendTableMetaData
{
this.primaryKeyField = tableMetaData.getPrimaryKeyField();
this.fields = new HashMap<>();
for(Map.Entry<String, QFieldMetaData> entry : tableMetaData.getFields().entrySet())
for(String fieldName : tableMetaData.getFields().keySet())
{
this.fields.put(entry.getKey(), new QFrontendFieldMetaData(entry.getValue()));
QFieldMetaData field = tableMetaData.getField(fieldName);
if(!field.getIsHidden())
{
this.fields.put(fieldName, new QFrontendFieldMetaData(field));
}
}
this.sections = tableMetaData.getSections();

View File

@ -1131,13 +1131,13 @@ public class QJavalinApiHandler
{
if(e instanceof QAuthenticationException)
{
respondWithError(context, HttpStatus.Code.UNAUTHORIZED, e.getMessage(), apiLog); // 401
respondWithError(context, HttpStatus.Code.UNAUTHORIZED, "The required authentication credentials were missing or invalid.", apiLog); // 401
return;
}
if(e instanceof QPermissionDeniedException)
{
respondWithError(context, HttpStatus.Code.FORBIDDEN, e.getMessage(), apiLog); // 403
respondWithError(context, HttpStatus.Code.FORBIDDEN, "You do not have permission to access the requested resource.", apiLog); // 403
return;
}