[server] change structure of ls response

This commit is contained in:
Abhishek Shroff
2024-10-30 13:06:05 +05:30
parent 32e3582c49
commit 8d653c473b

View File

@@ -9,9 +9,9 @@ import (
)
type ResourceLsResponse struct {
Metadata fs.Resource `json:"metadata"`
Children []serve.Resource `json:"children,omitempty"`
fs.Resource
InheritedPermissions string `json:"inherited,omitempty"`
Children []serve.Resource `json:"children,omitempty"`
}
func handleLsRequest(c *gin.Context) {
@@ -31,7 +31,7 @@ func handleLsRequest(c *gin.Context) {
func LsResponseFromResource(f fs.FileSystem, r fs.Resource) ResourceLsResponse {
response := ResourceLsResponse{
Metadata: r,
Resource: r,
InheritedPermissions: r.InheritedPermissions,
}
if r.Dir {