@wix/headless-forms 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -33,15 +33,15 @@ exports.FormService = services_definitions_1.implementService.withConfig()(expor
|
|
|
33
33
|
const hasSchema = 'form' in config;
|
|
34
34
|
const formSignal = signalsService.signal(hasSchema ? config.form : null);
|
|
35
35
|
if (!hasSchema) {
|
|
36
|
-
isLoadingSignal.set(true);
|
|
37
36
|
loadForm(config.formId);
|
|
38
37
|
}
|
|
39
38
|
async function loadForm(id) {
|
|
39
|
+
isLoadingSignal.set(true);
|
|
40
|
+
errorSignal.set(null);
|
|
40
41
|
try {
|
|
41
42
|
const result = await fetchForm(id);
|
|
42
43
|
if (result) {
|
|
43
44
|
formSignal.set(result);
|
|
44
|
-
console.log('result', !!result);
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
47
47
|
errorSignal.set('Form not found');
|
|
@@ -29,15 +29,15 @@ export const FormService = implementService.withConfig()(FormServiceDefinition,
|
|
|
29
29
|
const hasSchema = 'form' in config;
|
|
30
30
|
const formSignal = signalsService.signal(hasSchema ? config.form : null);
|
|
31
31
|
if (!hasSchema) {
|
|
32
|
-
isLoadingSignal.set(true);
|
|
33
32
|
loadForm(config.formId);
|
|
34
33
|
}
|
|
35
34
|
async function loadForm(id) {
|
|
35
|
+
isLoadingSignal.set(true);
|
|
36
|
+
errorSignal.set(null);
|
|
36
37
|
try {
|
|
37
38
|
const result = await fetchForm(id);
|
|
38
39
|
if (result) {
|
|
39
40
|
formSignal.set(result);
|
|
40
|
-
console.log('result', !!result);
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
43
|
errorSignal.set('Form not found');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/headless-forms",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run build:esm && npm run build:cjs",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"vitest": "^3.1.4"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@wix/form-public": "^0.
|
|
44
|
+
"@wix/form-public": "^0.15.0",
|
|
45
45
|
"@wix/forms": "^1.0.292",
|
|
46
46
|
"@wix/headless-utils": "0.0.3",
|
|
47
47
|
"@wix/services-definitions": "^0.1.4",
|