MCPcopy Create free account
hub / github.com/dfinity/orbit / submit

Function submit

apps/wallet/src/composables/forms.composable.ts:100–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98 };
99
100 const submit = async (): Promise<void> => {
101 try {
102 submitted.value = false;
103 const isValid = await revalidate();
104 valid.value = isValid;
105
106 if (!isValid) {
107 return;
108 }
109
110 submitting.value = true;
111
112 await opts.submit(model.value);
113
114 edited.value = false;
115 modelSnapshot.value = takeModelSnapshot(model.value);
116 submitted.value = true;
117 initialModel.value = deepClone(model.value);
118 } catch (error) {
119 logger.error('Failed to submit form', error);
120 } finally {
121 submitting.value = false;
122 }
123 };
124
125 onMounted(() => {
126 modelSnapshot.value = takeModelSnapshot(model.value);

Callers

nothing calls this directly

Calls 3

deepCloneFunction · 0.90
revalidateFunction · 0.85
submitMethod · 0.80

Tested by

no test coverage detected