mirror of https://github.com/4xmen/xshop.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
514 B
JavaScript
13 lines
514 B
JavaScript
8 months ago
|
window.addEventListener('load', function () {
|
||
|
const favUrl = document.querySelector('#api-fav-toggle').value;
|
||
|
document.querySelectorAll('.fav-btn')?.forEach(function (el) {
|
||
|
el.addEventListener('click', async function () {
|
||
|
let resp = await axios.get(favUrl+this.getAttribute('data-slug'));
|
||
|
if (resp.data.success){
|
||
|
this.setAttribute('data-is-fav',resp.data.data);
|
||
|
window.$toast.success(resp.data.message);
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|