Fix error thrown when attempting to add tag from person list

This commit is contained in:
Peter Stockings
2023-04-20 22:48:04 +10:00
parent b228ef8169
commit bdf1680b19

View File

@@ -53,7 +53,7 @@
confirmButtonText: 'Add',
showLoaderOnConfirm: true,
preConfirm: (tag) => {
return fetch(`{{ url_for('add_tag') }}?tag=${encodeURIComponent(tag)}&filter=${encodeURIComponent(window.location.search)}{% if person_id %} f'&person_id={person_id}' {% endif%}`)
return fetch(`{{ url_for('add_tag') }}?tag=${encodeURIComponent(tag)}&filter=${encodeURIComponent(window.location.search)}{% if person_id %} {{ "&person_id={person_id}".format(person_id=person_id) | safe }} {% endif%}`)
.then(response => {
if (!response.ok) {
throw new Error(response.statusText)