Join the Webstudio community

Home
Members
Richard
R
Richard
Offline, last seen 4 days ago
Joined December 13, 2024
Hey everyone, I've got this JSON in a resource using POST:

{
"currency": "USD",
"filtering": {
"destination": "55",
"tags": ["$system.search.experience"]
},
"pagination": {
"start": 1,
"count": 20
}
}

But get this error back from an API:

{
"ok": false,
"data": "Cannot deserialize value of type java.lang.Integer from String "$system.search.experience": not a valid java.lang.Integer value\n at [Source: REDACTED .........

So sounds like I need it to be an integer when it's a string. After multiple hours I cannot seem to get the right JSON to convert it into a number that the API will recognise

If I replace the system.search variable with a static number it works fine.

When I try {
currency: "USD",
filtering: {
destination: "55",
tags: [parseInt($system.search.experience)]
},
pagination: {
start: 1,
count: 20
}
}

It says "Functions are not support"

I wonder what I can do to get this into a number format?
5 comments
O
R
Hi, when I try to put the code below in an HTML Embed, I get "Unexpected token" as an error. Have I understood how to use the backticks and $ sign correctly? Thanks in advance



<style>
.accordion-header {
background-color: #f4f4f4;
color: #444;
cursor: pointer;
padding: 18px;
width: 100%;
text-align: left;
border: none;
outline: none;
transition: 0.4s;
}
.accordion-header:hover {
background-color: #ddd;
}
.accordion-content {
padding: 0 18px;
background-color: white;
display: none;
overflow: hidden;
}
.accordion-header:after {
content: '\002B';
color: #777;
font-weight: bold;
float: right;
margin-left: 5px;
}
.active:after {
content: "\2212";
}
</style>
<div class="accordion-item">
<button class="accordion-header"></button>
<div class="accordion-content">
<p>${Collection Item["Review_1_Name"]}</p>
</div>
</div>
<script>
document.addEventListener('click', function(e) {
if (!e.target.matches('.accordion-header')) return;

e.target.classList.toggle('active');
var content = e.target.nextElementSibling;
if (content.style.display === 'block') {
content.style.display = 'none';
} else {
content.style.display = 'block';
}
});
</script>
7 comments
O
R
Hi, is it possible to get the slug variable to go in /post/:slug from a Resource rather than GraphQL?

Context is I'm testing out Pocketbase https://pocketbase.io which doesn't have GraphQL, only an API

Thanks in advance
7 comments
O
R
The Supabase with Webstudio video you guys did was great to get me started, I've successfully got data onto the page from Supabase, with no database experience.

But it didn't mention how to get dynamic URLs.

From the Wordpress video, I know its something to do with putting :slug in the URL, and generating GraphQL to somehow map a slug field to SLUG

But I'm stuck after trying so many different things. Any tips please?
13 comments
M
c
O
R