Skip to content

Commit

Permalink
fix url in create entity
Browse files Browse the repository at this point in the history
  • Loading branch information
diversen7 committed Oct 26, 2023
1 parent a270a0d commit 7b31003
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions stadsarkiv_client/templates/entities/entities_create.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% include "includes/main_title.html" %}

<div id='editor_holder' class='small'></div>
<button id='submit'>{{ translate("Create entity") }}</button>
<button id='submit'>{{ "Create entity" }}</button>

<script type="module">

Expand Down Expand Up @@ -68,7 +68,7 @@

try {

const url = `/entities/patch-entity/${schema_type}`;
const url = `/entities/post-entity/${schema_type}`;
const res = await Requests.asyncPostJson(url, post_json);
if (res.error) {
Flash.setMessage(res.message, 'error', true)
Expand Down
16 changes: 8 additions & 8 deletions stadsarkiv_client/templates/entities/entities_update.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
{% block content %}
{% include "includes/main_title.html" %}


<div id='editor_holder' class='small'></div>
<button id='submit'>{{ translate("Update entity") }}</button>
<div class="entity-editor">
<div id='editor_holder' class='small'></div>
<button id='submit'>{{ "Opdater entitet" }}</button>
</div>
<script type="module">


import { Requests } from "/static/js/requests.js";
import { Flash } from "/static/js/flash.js";
import { getTranslation } from "/static/js/jsoneditor_utils.js";
Expand All @@ -38,14 +38,14 @@

JSONEditor.defaults.languages.da = translation
JSONEditor.defaults.language = "da";


var editor = new JSONEditor(document.getElementById('editor_holder'), options);

editor.on('ready', async function () {
editor.setValue({{ entity_json | safe }});
});

document.getElementById('submit').addEventListener('click', async function () {

try {
Expand Down Expand Up @@ -80,7 +80,7 @@

try {


const url = `/entities/patch-entity/${uuid}`;
const res = await Requests.asyncPostJson(url, post_json);
if (res.error) {
Expand Down

0 comments on commit 7b31003

Please sign in to comment.