adminforth 2.17.0-next.25 → 2.17.0-next.27
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.
|
@@ -103,7 +103,7 @@ const router = useRouter();
|
|
|
103
103
|
const record = ref({});
|
|
104
104
|
|
|
105
105
|
const coreStore = useCoreStore();
|
|
106
|
-
const {
|
|
106
|
+
const { api } = useAdminforth();
|
|
107
107
|
|
|
108
108
|
const { t } = useI18n();
|
|
109
109
|
|
|
@@ -119,8 +119,7 @@ async function onUpdateRecord(newRecord: any) {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
onBeforeMount(() => {
|
|
122
|
-
|
|
123
|
-
clearSaveInterceptors(route.params.resourceId as string);
|
|
122
|
+
api.clearSaveInterceptors(route.params.resourceId as string);
|
|
124
123
|
});
|
|
125
124
|
|
|
126
125
|
onMounted(async () => {
|
|
@@ -175,7 +174,7 @@ async function saveRecord() {
|
|
|
175
174
|
const requiredColumns = coreStore.resource?.columns.filter(c => c.required?.create === true) || [];
|
|
176
175
|
const requiredColumnsToSkip = requiredColumns.filter(c => checkShowIf(c, record.value, coreStore.resource?.columns || []) === false);
|
|
177
176
|
saving.value = true;
|
|
178
|
-
const interceptorsResult = await runSaveInterceptors({
|
|
177
|
+
const interceptorsResult = await api.runSaveInterceptors({
|
|
179
178
|
action: 'create',
|
|
180
179
|
values: record.value,
|
|
181
180
|
resource: coreStore.resource,
|
|
@@ -186,7 +185,7 @@ async function saveRecord() {
|
|
|
186
185
|
if (interceptorsResult.error) showErrorTost(interceptorsResult.error);
|
|
187
186
|
return;
|
|
188
187
|
}
|
|
189
|
-
const interceptorConfirmationResult = interceptorsResult.extra?.confirmationResult;
|
|
188
|
+
const interceptorConfirmationResult = (interceptorsResult.extra as Record<string, any>)?.confirmationResult;
|
|
190
189
|
const response = await callAdminForthApi({
|
|
191
190
|
method: 'POST',
|
|
192
191
|
path: `/create_record`,
|
|
@@ -87,7 +87,7 @@ import type { AdminForthResourceColumn } from '@/types/Back';
|
|
|
87
87
|
|
|
88
88
|
const { t } = useI18n();
|
|
89
89
|
const coreStore = useCoreStore();
|
|
90
|
-
const {
|
|
90
|
+
const { api } = useAdminforth();
|
|
91
91
|
|
|
92
92
|
const isValid = ref(false);
|
|
93
93
|
const validating = ref(false);
|
|
@@ -129,8 +129,7 @@ const editableRecord = computed(() => {
|
|
|
129
129
|
})
|
|
130
130
|
|
|
131
131
|
onBeforeMount(() => {
|
|
132
|
-
|
|
133
|
-
clearSaveInterceptors(route.params.resourceId as string);
|
|
132
|
+
api.clearSaveInterceptors(route.params.resourceId as string);
|
|
134
133
|
});
|
|
135
134
|
|
|
136
135
|
onMounted(async () => {
|
|
@@ -165,7 +164,7 @@ async function saveRecord() {
|
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
saving.value = true;
|
|
168
|
-
const interceptorsResult = await runSaveInterceptors({
|
|
167
|
+
const interceptorsResult = await api.runSaveInterceptors({
|
|
169
168
|
action: 'edit',
|
|
170
169
|
values: record.value,
|
|
171
170
|
resource: coreStore.resource,
|