Skip to content

Commit

Permalink
added webp support
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexxmao committed Aug 31, 2023
1 parent 7cd7e3b commit b8fb4ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function sanitizeInput($input)
$rarity = sanitizeInput($_POST['rarity']);
$price = sanitizeInput($_POST['price']);
$stock = sanitizeInput($_POST['stock']);
$allowedMimeTypes = array('image/jpeg', 'image/png', 'image/gif');
$allowedMimeTypes = array('image/jpeg', 'image/png', 'image/gif', 'image/webp');
$image = $_FILES['image']['name'];
$image_temp = $_FILES['image']['tmp_name'];
$imageType = $_FILES['image']['type'];
Expand Down
3 changes: 2 additions & 1 deletion src/components/DisplayListing.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function DisplayListing({admin}) {
editClose();
axios.put(`http://localhost:31337/api/listing/${id}/edit`, inputs).then((response) => {
console.log(response.data);
// window.location.reload(true);
window.location.reload(true);
});
}

Expand Down Expand Up @@ -94,6 +94,7 @@ export default function DisplayListing({admin}) {
},[sortType]);

const deleteListing = (id) => {
deleteAlertClose();
axios.delete(`http://localhost:31337/api/listings/${id}/delete`).then((response) =>{
console.log(response.data);
window.location.reload(true);
Expand Down

0 comments on commit b8fb4ae

Please sign in to comment.