Add a variable for storing Justwatch API URL

This commit is contained in:
Lucas Verney 2020-12-14 20:35:30 +01:00
parent 37074d60f1
commit 0afc3f2c5b

View File

@ -100,6 +100,8 @@
</div> </div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var JUSTWATCH_API_DOMAIN = 'https://apis.justwatch.com';
var app = new Vue({ var app = new Vue({
el: '#app', el: '#app',
computed: { computed: {
@ -295,7 +297,7 @@ var app = new Vue({
var promises = []; var promises = [];
this.checkedLocales.forEach((locale) => { this.checkedLocales.forEach((locale) => {
var searchItem = this.searchItems[index]; var searchItem = this.searchItems[index];
var url = `https://apis.justwatch.com/content/titles/${searchItem.type}/${searchItem.id}/locale/${locale}?language=fr` var url = `${JUSTWATCH_API_DOMAIN}/content/titles/${searchItem.type}/${searchItem.id}/locale/${locale}?language=fr`
promises.push(fetch(url) promises.push(fetch(url)
.then(response => response.json()) .then(response => response.json())
.then(response => { .then(response => {