Skip to content
Snippets Groups Projects
Verified Commit 0e08047f authored by Martin Weise's avatar Martin Weise
Browse files

Fixed endpoint

parent b3f4449c
No related branches found
No related tags found
1 merge request!366Hotfix/ui view
......@@ -33,6 +33,7 @@ import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Row;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
......@@ -368,7 +369,7 @@ public class SubsetEndpoint extends AbstractEndpoint {
final ViewDto view = schemaService.inspectView(database, metadataMapper.queryDtoToViewName(subset));
headers.set("Access-Control-Expose-Headers", "X-Id X-Headers");
headers.set("X-Headers", String.join(",", view.getColumns().stream().map(ViewColumnDto::getInternalName).toList()));
return ResponseEntity.ok()
return ResponseEntity.status(request.getMethod().equals("POST") ? HttpStatus.CREATED : HttpStatus.OK)
.headers(headers)
.body(transform(dataset));
} catch (SQLException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment