swe574-spring23 / SWE574

BOUN Spring 574 Project
MIT License
0 stars 0 forks source link

BUG - Annotation Creator #176

Closed sehmuzc closed 10 months ago

sehmuzc commented 10 months ago

When I make a text annotation in production environment the creator value is not set. function saveAnnotation does not have creator part. When I make an image annotation in production environment the annotation author is set as post author but it should be requesting user. Creator field should be corrected both in text and image annotations.

                'body': {
                    'type': 'TextualBody',
                    'value': annotation,
                    'format': 'text/plain',
                    'creator': '{{post.author}}'
                },
sehmuzc commented 10 months ago
<script>
    function saveImageAnnotation(post_id, post_text, type, creator) {
    }
</script>

<button onclick="saveImageAnnotation('{{ post.id }}', '{{ post.text }}', '{{ post.type }}', '{{ user.username }}')">Save Annotation</button>

function saveImageAnnotation(post_id, post_text, type, creator) {
    const annotation = document.getElementById('annotation').value;
    let data = {
        '@context': 'http://www.w3.org/ns/anno.jsonld',
        'type': 'Annotation',
        'body': {
            'type': 'TextualBody',
            'value': annotation,
            'format': 'text/plain',
            'creator': creator
        },
SahinKapan commented 10 months ago

813abff2954e5385691b239b52f5c39c4e605658

It is fixed by this commit.