Skip to content

Commit

Permalink
Fixed typo and removed tagLine from watch responses
Browse files Browse the repository at this point in the history
  • Loading branch information
jponsen committed Nov 18, 2024
1 parent 8f5cfc7 commit ce48c0c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Wristler WordPress Plugin #
**Contributors:** [jponsen](https://profiles.wordpress.org/jponsen)
**Contributors:** [jponsen](https://github.com/jponsen)
**Tags:** wordpress, wristler
**Requires at least:** 6.0
**Requires PHP:** >= 7.4
**Tested up to:** 6.2.2
**Stable tag:** 1.2.2
**Stable tag:** 1.3.0
**License:** MIT
**License URI:** https://opensource.org/licenses/MIT

Expand Down
15 changes: 4 additions & 11 deletions resources/js/admin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Wrislter = {
const Wristler = {

watches: [],

Expand Down Expand Up @@ -83,7 +83,7 @@ const Wrislter = {
return;
}

referenceInput.addEventListener('input', Wrislter.debounce(event => {
referenceInput.addEventListener('input', Wristler.debounce(event => {
curObj.showLoader();
curObj.selectedWatch = null;
curObj.watches = [];
Expand Down Expand Up @@ -113,7 +113,6 @@ const Wrislter = {
<a data-id="${watch.id}" href="#">
<h4>${watch.title} <small>${watch.reference}</small></h4>
${watch.name && watch.name.length > 0 ? `<p>${watch.name}</p>` : ''}
<p>${watch.tagLine}</p>
</a>
</li>
`;
Expand Down Expand Up @@ -193,7 +192,6 @@ const Wrislter = {
<h3>${WRISTLER.selectedWatch}</h3>
<h4>${this.selectedWatch.title} <small>${this.selectedWatch.reference}</small></h4>
${this.selectedWatch.name && this.selectedWatch.name.length > 0 ? `<p>${this.selectedWatch.name}</p>` : ''}
<p>${this.selectedWatch.tagLine}</p>
</div>
`;
}
Expand All @@ -219,16 +217,11 @@ const Wrislter = {
},

formatResource: function (watch) {
let tags = ['category', 'gender', 'movement', 'caseSize', 'dial'].map(tag => {
return watch[tag] && watch[tag].length > 0 ? watch[tag] : null;
}).filter(tag => tag !== null);

return {
id: watch.uuid,
reference: watch.reference,
title: `${watch.brand} ${watch.model}`,
name: watch.name,
tagLine: tags.join(' / ')
}
},

Expand All @@ -243,7 +236,7 @@ const Wrislter = {
request: function (path) {
const token = document.querySelector('input[name="wristler_security_token"]').value;

return fetch(`https://data.wristler.eu/api/v1/${path}`, {
return fetch(`https://data.wristler.test/api/v1/${path}`, {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
Expand All @@ -259,4 +252,4 @@ const Wrislter = {
}
}

document.addEventListener("DOMContentLoaded", () => Wrislter.init());
document.addEventListener("DOMContentLoaded", () => Wristler.init());
4 changes: 2 additions & 2 deletions wristler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Wristler
Plugin URI: https://wristler.eu
Description: This plug-ins allows your WooCommerce shop to sync with Wristler for automated stock updates.
Version: 1.2.2
Version: 1.3.0
Requires PHP: 7.4
Author: Wristler
Author URI: https://wristler.eu
Expand Down Expand Up @@ -31,7 +31,7 @@
class Wristler
{

const VERSION = '1.2.2';
const VERSION = '1.3.0';

protected static $instance;

Expand Down

0 comments on commit ce48c0c

Please sign in to comment.