Skip to content
Snippets Groups Projects
Verified Commit f65c1d7f authored by Owen Graham's avatar Owen Graham
Browse files

Serve source links as JSON

parent ca4d4e26
Branches
No related tags found
No related merge requests found
......@@ -133,7 +133,7 @@ function sourceLink(name, year, n) {
a.title = 'AMRDC Data Repository';
div.appendChild(a);
fetch(`${$SCRIPT_ROOT}/record/link${paramString({name, year})}`)
.then(response => response.text())
.then(response => response.json())
.then(response => {
a.href = response;
});
......
......
......@@ -310,7 +310,7 @@ def get_link(name, year):
def get_record_link():
name = get_query('name')
year = get_query('year', to=year_type)
return get_link(name, year)
return jsonify(get_link(name, year))
def get_resources(link):
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment