Skip to content

Commit 6f0e53c

Browse files
committed
Make the local scratch test work again
This moves the assets around to where they are expected.
1 parent 3aa172f commit 6f0e53c

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

public/api/assets/internalapi/asset/8a9dadf4eea61892ec6908b1c99e4961.svg/get renamed to public/api/scratch/assets/internalapi/asset/8a9dadf4eea61892ec6908b1c99e4961.svg/get

File renamed without changes.
File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"identifier": "blank-scratch",
2+
"identifier": "cool-scratch.json",
33
"project_type": "code_editor_scratch",
44
"locale": "en",
5-
"name": "Blank Scratch Project",
5+
"name": "Sample Scratch Project",
66
"user_id": null,
77
"instructions": {
88
"content": "instructions go here",

src/web-component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<a href="#" data-project="blank-python-starter">blank-python-starter</a>
6161
<a href="#" data-project="cool-python">cool-python</a>
6262
<a href="#" data-project="python-plotly">python-plotly</a>
63-
<a href="#" data-project="blank-scratch">blank-scratch</a>
63+
<a href="#" data-project="cool-scratch">cool-scratch</a>
6464
</div>
6565
<div id="editor-component"></div>
6666
<p id="results"></p>
@@ -114,6 +114,10 @@
114114
newWebComp.setAttribute("code", "");
115115
newWebComp.setAttribute("class", "editor-wc");
116116
newWebComp.setAttribute("host_styles", JSON.stringify([]));
117+
const scratchApiEndpoint = new URL(".", window.location.href)
118+
.href
119+
.replace(/\/$/, "");
120+
newWebComp.setAttribute("scratch_api_endpoint", scratchApiEndpoint);
117121

118122
queryParams.forEach((value, key) => {
119123
newWebComp.setAttribute(key, value);

0 commit comments

Comments
 (0)