use schema from blueprint for fetch only

This commit is contained in:
Ajit Bohra 2025-07-24 22:43:25 +05:30
parent 939ed2c1c2
commit 93750f33f3
2 changed files with 4 additions and 3 deletions

View file

@ -11,7 +11,8 @@ export const PLAYGROUND_BUILDER_BASE = "https://href.li/?https://playground.word
/**
* Playground blueprint schema url
*/
export const PLAYGROUND_BLUEPRINT_SCHEMA_URL = "https://raw.githubusercontent.com/WordPress/wordpress-playground/refs/heads/trunk/packages/playground/blueprints/public/blueprint-schema.json";
export const PLAYGROUND_BLUEPRINT_SCHEMA_URL = "https://playground.wordpress.net/blueprint-schema.json";
export const PLAYGROUND_BLUEPRINT_SCHEMA_URL_FETCH = "https://raw.githubusercontent.com/WordPress/wordpress-playground/refs/heads/trunk/packages/playground/blueprints/public/blueprint-schema.json";

/**
* PHP versions.

View file

@ -4,7 +4,7 @@
import { __ } from '@wordpress/i18n';
import { createBlock } from "@wordpress/blocks";
import { dispatch, useSelect, useDispatch } from '@wordpress/data';
import { PLAYGROUND_BLUEPRINT_SCHEMA_URL } from './constant';
import { PLAYGROUND_BLUEPRINT_SCHEMA_URL, PLAYGROUND_BLUEPRINT_SCHEMA_URL_FETCH } from './constant';
import { useCallback } from '@wordpress/element';

/**
@ -88,7 +88,7 @@ const updateDeprecatedFields = (jsonData) => {
*/
const validateAgainstSchema = async (data, createNotice) => {
try {
const response = await fetch(PLAYGROUND_BLUEPRINT_SCHEMA_URL);
const response = await fetch(PLAYGROUND_BLUEPRINT_SCHEMA_URL_FETCH);
if (!response.ok) {
throw new Error('Failed to fetch schema.');
}