Skip to content

Commit

Permalink
fixed window bug and changed way of sending the request for creating/…
Browse files Browse the repository at this point in the history
…editing a post
  • Loading branch information
Genadi888 committed Aug 18, 2023
1 parent 304dd33 commit 0f30f17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/api/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export async function getPostById(id) {
}

export async function createPost(post) {
addEntryWithUserPointer(post, 'owner');
return api.post('/functions/createPost', post);
}

Expand All @@ -33,7 +32,6 @@ export async function deletePost(postId) {
}

export async function editPost(newPost) {
addEntryWithUserPointer(newPost, 'owner');
return api.post(`/functions/editPost`, newPost);
}

Expand Down
12 changes: 9 additions & 3 deletions src/views/car-pictures/infoWindow/infoWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ function showOrHideWindow(moreInfoWindow) {
moreInfoWindow.style.opacity = 1;
} else {
//? here we clean up the publishComment section
moreInfoWindow.querySelector('textarea').value = "";
const dataset = moreInfoWindow.querySelector('#publish-comment>.btn-primary').dataset;
Object.keys(dataset).forEach(key => delete dataset[key]);

if (moreInfoWindow.querySelector('textarea')) {
moreInfoWindow.querySelector('textarea').value = "";
}

if (moreInfoWindow.querySelector('#publish-comment')) {
const dataset = moreInfoWindow.querySelector('#publish-comment>.btn-primary').dataset;
Object.keys(dataset).forEach(key => delete dataset[key]);
}

moreInfoWindow.style['pointer-events'] = 'none';
moreInfoWindow.style.opacity = 0;
Expand Down

0 comments on commit 0f30f17

Please sign in to comment.