Skip to content
Snippets Groups Projects
Commit f0bf2ce6 authored by Petar Hristov's avatar Petar Hristov :speech_balloon:
Browse files

Fix: Linked Resources now working (coscine/issues#1616)

parent 49c14cff
Branches Hotfix/1616-repairLinkedResources
Tags
1 merge request!38Hotfix/1616 repair linked resources
......@@ -83,7 +83,7 @@ namespace Coscine.Api.Tree.Controllers
/// <param name="path">Path to the file</param>
/// <returns> JSON Object with the metadata if ok, otherwise Statuscode 400 or 401 or 404</returns>
[HttpGet("[controller]/{resourceId}/{*path}")]
public async Task<IActionResult> GetMetadata(string resourceId, string path)
public async Task<IActionResult> GetMetadata(string resourceId, string path = "")
{
var rawPath = path;
path = $"/{path}";
......@@ -167,12 +167,12 @@ namespace Coscine.Api.Tree.Controllers
["Download"] = new JObject
{
["Method"] = "GET",
["Url"] = resourceTypeDefinition?.GetEntryDownloadUrl(rawPath, null, resourceTypeOptions).Result.ToString()
["Url"] = resourceTypeDefinition?.GetEntryDownloadUrl(rawPath, null, resourceTypeOptions).Result?.ToString()
},
["Upload"] = new JObject
{
["Method"] = "PUT",
["Url"] = resourceTypeDefinition?.GetEntryStoreUrl(rawPath, null, resourceTypeOptions).Result.ToString()
["Url"] = resourceTypeDefinition?.GetEntryStoreUrl(rawPath, null, resourceTypeOptions).Result?.ToString()
}
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment