Skip to content

Commit

Permalink
bug fix - calendar rest url parse issue
Browse files Browse the repository at this point in the history
  • Loading branch information
imrantushar committed Jun 29, 2021
1 parent 4487f25 commit 7337f46
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
1 change: 0 additions & 1 deletion admin/class-wpscp-calendar.php

This file was deleted.

30 changes: 13 additions & 17 deletions assets/js/wpscp-fullcalendar-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,21 +554,16 @@ document.addEventListener('DOMContentLoaded', function () {
* Get Post Type Name form Query Sting
*/
function wpscpGetPostTypeNameSkipUnderScore(oldRestUrl, obj) {
// return oldRestUrl
var urlParams = new URLSearchParams(window.location.search)

var query = JSON.parse(new URLSearchParams(oldRestUrl).get('query'))
var mergeQuery = Object.assign(query, obj)

// var postTypeName =
// urlParams.get('post_type') == 'elementor_library'
// ? 'elementorlibrary'
// : urlParams.get('post_type')
return (
wpscp_calendar_ajax_object.site_url +
'?rest_route=/wpscp/v1/calendar&query=' +
JSON.stringify(mergeQuery)
)
if (query) {
var mergeQuery = Object.assign(query, obj)
return (
wpscp_calendar_ajax_object.site_url +
'?rest_route=/wpscp/v1/calendar&query=' +
JSON.stringify(mergeQuery)
)
}
return oldRestUrl
}

/**
Expand Down Expand Up @@ -754,9 +749,10 @@ document.addEventListener('DOMContentLoaded', function () {
e.params.data.element.dataset.termlist !== '' &&
e.params.data.element.dataset.termlist !== undefined
) {
var termlist = e.params.data.element.dataset.termlist.split(
' '
)
var termlist =
e.params.data.element.dataset.termlist.split(
' '
)
termlist.forEach(function (item) {
// console.log(item)
jQuery(
Expand Down

0 comments on commit 7337f46

Please sign in to comment.