diff --git a/src/components/ItemComponents/NewItemForm.vue b/src/components/ItemComponents/NewItemForm.vue index 4e5fff4a64e1b606296963dcbbaefbcd71838703..f75f49eaac9d194ca0b952dcf63eabbba8f5073a 100644 --- a/src/components/ItemComponents/NewItemForm.vue +++ b/src/components/ItemComponents/NewItemForm.vue @@ -216,7 +216,12 @@ <script> import useVuelidate from "@vuelidate/core"; import { parseUserFromToken } from "@/utils/token-utils"; -import {postNewItem, getMyGroups, postNewImageCommunity, PostImagesArrayToListing} from "@/utils/apiutil"; +import { + postNewItem, + getMyGroups, + postNewImageCommunity, + PostImagesArrayToListing, +} from "@/utils/apiutil"; import Button from "@/components/BaseComponents/ColoredButton"; import { @@ -366,7 +371,6 @@ export default { //Not sure if this will work that.item.imagesToSend.push(API_URL + "images/" + id); - }; fileReader.readAsArrayBuffer(image); }, diff --git a/src/utils/apiutil.js b/src/utils/apiutil.js index 94221032becec82269c8a9de7473bdb4fb4831c4..f72cdd3450d60653621fce6966ef4ccd3231b263 100644 --- a/src/utils/apiutil.js +++ b/src/utils/apiutil.js @@ -343,14 +343,14 @@ export function postNewImageCommunity(image) { export function PostImagesArrayToListing(imagesArray) { return axios - .post(API_URL + "listing/pictures", imagesArray, { - headers: tokenHeader(), - }) - .then((response) => { - return response; - }) - .catch((error) => { - console.error(error.response); - return error; - }); + .post(API_URL + "listing/pictures", imagesArray, { + headers: tokenHeader(), + }) + .then((response) => { + return response; + }) + .catch((error) => { + console.error(error.response); + return error; + }); } diff --git a/tests/unit/component-tests/user-component-tests/__snapshots__/rating.spec.js.snap b/tests/unit/component-tests/user-component-tests/__snapshots__/rating.spec.js.snap index e7d04a61c2d249a8bda1825ed17ed7be65bcf319..f22076edecd3620957e0bbf9141873adfd3a6322 100644 --- a/tests/unit/component-tests/user-component-tests/__snapshots__/rating.spec.js.snap +++ b/tests/unit/component-tests/user-component-tests/__snapshots__/rating.spec.js.snap @@ -11,73 +11,11 @@ exports[`Rating component renders correctly 1`] = ` : </p> </li> - - <li> - <svg - class="w-5 h-5 text-gray-300 dark:text-gray-500" - fill="currentColor" - viewBox="0 0 20 20" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" - /> - </svg> - </li> - <li> - <svg - class="w-5 h-5 text-gray-300 dark:text-gray-500" - fill="currentColor" - viewBox="0 0 20 20" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" - /> - </svg> - </li> - <li> - <svg - class="w-5 h-5 text-gray-300 dark:text-gray-500" - fill="currentColor" - viewBox="0 0 20 20" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" - /> - </svg> - </li> - <li> - <svg - class="w-5 h-5 text-gray-300 dark:text-gray-500" - fill="currentColor" - viewBox="0 0 20 20" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" - /> - </svg> - </li> - <li> - <svg - class="w-5 h-5 text-gray-300 dark:text-gray-500" - fill="currentColor" - viewBox="0 0 20 20" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" - /> - </svg> - </li> - <li> <p class="ml-2 text-sm font-medium text-gray-500 dark:text-gray-400" > - out of 5 + Ingen vurderinger </p> </li> </ul>